Re: "plan should not reference subplan's variable" when using row level security - Mailing list pgsql-general

From Adam Guthrie
Subject Re: "plan should not reference subplan's variable" when using row level security
Date
Msg-id CAC3DOVwf4s5ftjVSOrpSHVdxR=mMhSqsORmRcaryAqTzrRjRTg@mail.gmail.com
Whole thread Raw
In response to Re: "plan should not reference subplan's variable" when using row level security  (Stephen Frost <sfrost@snowman.net>)
Responses Re: "plan should not reference subplan's variable" when using row level security  (Stephen Frost <sfrost@snowman.net>)
List pgsql-general
On 24 February 2016 at 20:27, Stephen Frost <sfrost@snowman.net> wrote:
> Yeah, looks like a bug to me.  My gut reaction is that we're pulling up
> a subquery in a way that isn't possible and that plan shouldn't be
> getting built/considered.

Thanks - shall I go ahead and submit a bug report?

>
> As a work-around, until we fix it, you could create an sql function to
> check for the existance of the id in 'a' and use that in the policy
> definition.

I've also discovered that using the following policy instead

CREATE POLICY a_select ON b FOR SELECT
    USING ( a_id IN (SELECT id FROM a) );

also seems to work around the issue.


pgsql-general by date:

Previous
From: Stephen Frost
Date:
Subject: Re: "plan should not reference subplan's variable" when using row level security
Next
From: Stephen Frost
Date:
Subject: Re: "plan should not reference subplan's variable" when using row level security