Re: BUG #15708: RLS 'using' running as wrong user when called from a view

2019-04-29 Thread Dean Rasheed
On Mon, 29 Apr 2019 at 04:56, Daurnimator wrote: > > On Wed, 27 Mar 2019 at 23:46, Dean Rasheed wrote: > > On second thoughts, it actually needs to be in > > get_row_security_policies(), after making copies of the quals from the > > policies, otherwise it would be scribbling on the copies from th

Re: BUG #15708: RLS 'using' running as wrong user when called from a view

2019-04-28 Thread Daurnimator
On Wed, 27 Mar 2019 at 23:46, Dean Rasheed wrote: > On second thoughts, it actually needs to be in > get_row_security_policies(), after making copies of the quals from the > policies, otherwise it would be scribbling on the copies from the > relcache. Actually that makes the code change a bit simp

Re: BUG #15708: RLS 'using' running as wrong user when called from a view

2019-03-27 Thread Dean Rasheed
On Mon, 25 Mar 2019 at 20:27, Stephen Frost wrote: > > * Dean Rasheed (dean.a.rash...@gmail.com) wrote: > > > It looks like the best place to fix it is in > > get_policies_for_relation(), since that's where all the policies to be > > applied for a given RTE are pulled together. Patch attached. > >

Re: BUG #15708: RLS 'using' running as wrong user when called from a view

2019-03-25 Thread Stephen Frost
Greetings, * Dean Rasheed (dean.a.rash...@gmail.com) wrote: > On Thu, 21 Mar 2019 at 00:39, PG Bug reporting form > wrote: > > > > This fails, seemingly because the RLS on 'bar' is being checked by alice, > > instead of the view owner bob: > > Yes I agree, that appears to be a bug. The subquery

Re: BUG #15708: RLS 'using' running as wrong user when called from a view

2019-03-24 Thread Dean Rasheed
On Thu, 21 Mar 2019 at 00:39, PG Bug reporting form wrote: > > This fails, seemingly because the RLS on 'bar' is being checked by alice, > instead of the view owner bob: > Yes I agree, that appears to be a bug. The subquery in the RLS policy should be checked as the view owner -- i.e., we need to