Re: BUG #15708: RLS 'using' running as wrong user when called from a view - Mailing list pgsql-bugs

From Dean Rasheed
Subject Re: BUG #15708: RLS 'using' running as wrong user when called from a view
Date
Msg-id CAEZATCXm7x45myKcg4c+SbMVAVCeLtx9u5K2JhN2rJjWbKKOyQ@mail.gmail.com
Whole thread Raw
In response to Re: BUG #15708: RLS 'using' running as wrong user when called from aview  (Stephen Frost <sfrost@snowman.net>)
Responses Re: BUG #15708: RLS 'using' running as wrong user when called from a view  (Daurnimator <quae@daurnimator.com>)
Re: BUG #15708: RLS 'using' running as wrong user when called from a view  (Daurnimator <quae@daurnimator.com>)
List pgsql-bugs
On Mon, 25 Mar 2019 at 20:27, Stephen Frost <sfrost@snowman.net> wrote:
>
> * Dean Rasheed (dean.a.rasheed@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.
>
> Yes, on a quick review, that looks like a good solution to me as well.
>

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 simpler too.

Regards,
Dean

Attachment

pgsql-bugs by date:

Previous
From: Anthony Sotolongo
Date:
Subject: Re: BUG #15714: plctl extension issue
Next
From: Tom Lane
Date:
Subject: Re: BUG #15715: UPDATE using "in (subquery for update limit 1)" does not respect the limit in subquery