Re: RLS in CTE incorrect permission failure

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Rod Taylor <rod(dot)taylor(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org, Stephen Frost <sfrost(at)snowman(dot)net>
Subject: Re: RLS in CTE incorrect permission failure
Date: 2017-06-21 23:46:51
Message-ID: 22863.1498088811@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Rod Taylor <rod(dot)taylor(at)gmail(dot)com> 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 anything inserted by that query.

Possibly it'd work as you wish with a VOLATILE function.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2017-06-21 23:52:16 Re: [COMMITTERS] pgsql: Restart logical replication launcher when killed
Previous Message Michael Paquier 2017-06-21 23:46:35 Re: [COMMITTERS] pgsql: Restart logical replication launcher when killed