Re: Triggers on underlying tables of updatable views

2021-12-02 Thread Max Ziermann
I'm not sure where in the docs a clarification could best be placed. For me, the confusion arises from the fact that the updatable views section on the CREATE VIEW docs aren't very clear what *actually* happens when performing insert/update etc. through a view. It seems like the distinction between

Re: Triggers on underlying tables of updatable views

2021-12-01 Thread Laurenz Albe
On Wed, 2021-12-01 at 21:34 +0100, Max Ziermann wrote: > I'm not sure where in the docs a clarification could best be placed. For > me, the confusion arises from the fact that the updatable views section > on the CREATE VIEW docs aren't very clear what *actually* happens when > performing insert/up

Re: Triggers on underlying tables of updatable views

2021-11-23 Thread Laurenz Albe
On Mon, 2021-11-22 at 21:02 +0100, Laurenz Albe wrote: > On Mon, 2021-11-22 at 19:54 +0100, Max Ziermann wrote: > > Am 22.11.21 um 16:41 schrieb Laurenz Albe: > > > On Mon, 2021-11-22 at 12:06 +, PG Doc comments form wrote: > > > > "Note that the user performing the insert, update or delete on

Re: Triggers on underlying tables of updatable views

2021-11-22 Thread Max Ziermann
Thanks for your reply. Maybe I am missing an obvious point, but I don't think that's the case. SQL example: CREATE ROLE view_access; CREATE TABLE data (a integer primary key); CREATE VIEW data_view AS SELECT * FROM data; GRANT SELECT, INSERT ON data_view TO view_access; CREATE FUNCTION trig() R

Re: Triggers on underlying tables of updatable views

2021-11-22 Thread Laurenz Albe
On Mon, 2021-11-22 at 19:54 +0100, Max Ziermann wrote: > Am 22.11.21 um 16:41 schrieb Laurenz Albe: > > On Mon, 2021-11-22 at 12:06 +, PG Doc comments form wrote: > > > "Note that the user performing the insert, update or delete on the view > > > must > > > have the corresponding insert, updat

Re: Triggers on underlying tables of updatable views

2021-11-22 Thread Laurenz Albe
On Mon, 2021-11-22 at 12:06 +, PG Doc comments form wrote: > "Note that the user performing the insert, update or delete on the view must > have the corresponding insert, update or delete privilege on the view. In > addition the view's owner must have the relevant privileges on the > underlying