Re: updateble views - Mailing list pgsql-novice

From Tom Lane
Subject Re: updateble views
Date
Msg-id 15792.1019259100@sss.pgh.pa.us
Whole thread Raw
In response to updateble views  (thiemo <thiemo@gmx.ch>)
List pgsql-novice
thiemo <thiemo@gmx.ch> writes:
> I have a table that I want users to access to only through a view. For=20
> the inserts, I have defined a rule.  I granted insert rights on the base=20
> table and view as well as select rights on the view to the users.=20
> However, a users trying an insert on the view gets an "Error while=20
> executing statement: ERROR:  s_pwd.nextval: you don't have permissions=20
> to set sequence s_pwd". Is there a right I need to grant to the users=20
> regarding the sequence?

Unfortunately, you'll have to give 'em update rights on the sequence.

This should be checked against the rule owner's permissions, not the
rule user's permissions, but nextval() has no idea it's being executed
as the result of rule expansion rather than something the user typed
directly :-(

            regards, tom lane

pgsql-novice by date:

Previous
From: "Josh Berkus"
Date:
Subject: Re: updateble views
Next
From: sophie yang
Date:
Subject: Re: algebraic rewriting