pgsql: Apply SELECT policies in INSERT/UPDATE+RETURNING

Started by Stephen Frostover 10 years ago3 messages
#1Stephen Frost
sfrost@snowman.net

Apply SELECT policies in INSERT/UPDATE+RETURNING

Similar to 7d8db3e, given that INSERT+RETURNING requires SELECT rights
on the table, apply the SELECT policies as WCOs to the tuples being
inserted. Apply the same logic to UPDATE+RETURNING.

Back-patch to 9.5 where RLS was added.

Branch
------
REL9_5_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/bd9014768035dd70f8cc33c215a8b929c2e13a35

Modified Files
--------------
src/backend/rewrite/rowsecurity.c | 32 +++++++++++++++++++++++++++++---
1 file changed, 29 insertions(+), 3 deletions(-)

--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers

#2Peter Geoghegan
pg@heroku.com
In reply to: Stephen Frost (#1)
Re: pgsql: Apply SELECT policies in INSERT/UPDATE+RETURNING

On Mon, Oct 5, 2015 at 4:55 AM, Stephen Frost <sfrost@snowman.net> wrote:

Apply SELECT policies in INSERT/UPDATE+RETURNING

If we've changed this now, where does that leave the excluded.* pseudo-relation?

--
Peter Geoghegan

--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers

#3Stephen Frost
sfrost@snowman.net
In reply to: Peter Geoghegan (#2)
Re: [COMMITTERS] pgsql: Apply SELECT policies in INSERT/UPDATE+RETURNING

Peter,

On Monday, October 5, 2015, Peter Geoghegan <pg@heroku.com> wrote:

On Mon, Oct 5, 2015 at 4:55 AM, Stephen Frost <sfrost@snowman.net
<javascript:;>> wrote:

Apply SELECT policies in INSERT/UPDATE+RETURNING

If we've changed this now, where does that leave the excluded.*
pseudo-relation?

Away from my keyboard at the moment, and I'm sure Andres can comment, but I
didn't see this commit as changing anything regarding how excluded should
be handled (which Andres and I had at least seemed to come to an agreement
on).

Thanks!

Stephen