Re: INSERT ... ON CONFLICT UPDATE and RLS - Mailing list pgsql-hackers

From Peter Geoghegan
Subject Re: INSERT ... ON CONFLICT UPDATE and RLS
Date
Msg-id CAM3SWZTwXSOLzyMot0chABoCktFgZR676D93LXWyasC4_+oWuQ@mail.gmail.com
Whole thread Raw
In response to Re: INSERT ... ON CONFLICT UPDATE and RLS  (Stephen Frost <sfrost@snowman.net>)
List pgsql-hackers
On Fri, Jan 9, 2015 at 12:53 PM, Stephen Frost <sfrost@snowman.net> wrote:
> I'm not sure how that would work exactly though, since the tuple the
> UPDATE results in might be different from what the INSERT has, as Dean
> pointed out.  The INSERT tuple might even pass the UPDATE policy where
> the resulting tuple from the actual UPDATE part doesn't.

I'm not suggesting that Dean's example is totally without merit (his
revised explanation made it clearer what he meant). I just think, on
balance, that enforcing all INSERT + UPDATE policies at various points
is the best behavior. Part of the reason for that is that if you ask
people how they think it works, you'll get as many answers as the
number of people you ask. My proposal (which may or may not be the
same as yours, but if not is only slightly more restrictive) is
unlikely to affect many users negatively, and is relatively easy to
explain and reason about. There are workarounds for Dean's case, too.

-- 
Peter Geoghegan



pgsql-hackers by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: INSERT ... ON CONFLICT UPDATE and RLS
Next
From: Stephen Frost
Date:
Subject: Re: INSERT ... ON CONFLICT UPDATE and RLS