Re: [HACKERS] RLS in CTE incorrect permission failure

2017-06-21 Thread Rod Taylor
On Wed, Jun 21, 2017 at 7:46 PM, Tom Lane wrote: > Rod Taylor writes: > > In the attached script, the second insert into t2 (as part of the CTE) > > should succeed. > > No, I don't think so. You declared the check function as STABLE which > means it is

Re: [HACKERS] RLS in CTE incorrect permission failure

2017-06-21 Thread Tom Lane
Rod Taylor writes: > In the attached script, the second insert into t2 (as part of the CTE) > should succeed. No, I don't think so. You declared the check function as STABLE which means it is confined to seeing the same snapshot as the surrounding query. So it can't see

[HACKERS] RLS in CTE incorrect permission failure

2017-06-21 Thread Rod Taylor
In the attached script, the second insert into t2 (as part of the CTE) should succeed. My actual use case isn't much more complex; the function is used primarily to allow peaking at columns that the function definer has access to but a typical user does not. Function also makes it easy to copy