updateble views

Поиск
Список
Период
Сортировка
Искать

updateble views

От:
thiemo <thiemo@gmx.ch>
Дата:
Hi,


I have a table that I want users to access to only through a view. For
the inserts, I have defined a rule.  I granted insert rights on the
base table and view as well as select rights on the view to the users.
However, a users trying an insert on the view gets an "Error while
executing statement: ERROR:  s_pwd.nextval: you don't have permissions
to set sequence s_pwd". Is there a right I need to grant to the users
regarding the sequence?


Thx


Thiemo

Helvetica

--

Thiemo Kellner

Tösstalstrasse 146

CH-8400 Winterthur

Hi,

I have a table that I want users to access to only through a view. For 
the inserts, I have defined a rule.  I granted insert rights on the base 
table and view as well as select rights on the view to the users. 
However, a users trying an insert on the view gets an "Error while 
executing statement: ERROR:  s_pwd.nextval: you don't have permissions 
to set sequence s_pwd". Is there a right I need to grant to the users 
regarding the sequence?

Thx

Thiemo

--
Thiemo Kellner
Tösstalstrasse 146
CH-8400 Winterthur

Re: updateble views

От:
"Josh Berkus" <josh@agliodbs.com>
Дата:
Thiemo,

> I have a table that I want users to access to only through a view.
> For the inserts, I have defined a rule.  I granted insert rights on
> the base table and view as well as select rights on the view to the
> users. However, a users trying an insert on the view gets an "Error
> while executing statement: ERROR:  s_pwd.nextval: you don't have
> permissions to set sequence s_pwd". Is there a right I need to grant
> to the users regarding the sequence?

Yes.
GRANT SELECT, UPDATE ON  TO ;

-Josh Berkus

Re: updateble views

От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
thiemo  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
FAQ