Re: RLS fails to work with UPDATE ... WHERE CURRENT OF

From: Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Joe Conway <mail(at)joeconway(dot)com>, Peter Geoghegan <pg(at)heroku(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>, Stephen Frost <sfrost(at)snowman(dot)net>
Subject: Re: RLS fails to work with UPDATE ... WHERE CURRENT OF
Date: 2015-07-14 19:40:40
Message-ID: CAEZATCVPYCAkavRygv5Df8X3MXXQB1PMTRdMdad+j4z8NeGW9w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 14 July 2015 at 13:59, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> On Thu, Jul 9, 2015 at 5:47 PM, Joe Conway <mail(at)joeconway(dot)com> wrote:
>> On 06/08/2015 02:08 AM, Dean Rasheed wrote:
>>> Actually I think it is fixable just by allowing the CURRENT OF
>>> expression to be pushed down into the subquery through the
>>> security barrier view. The planner is then guaranteed to generate a
>>> TID scan, filtering by any other RLS quals, which ought to be the
>>> optimal plan. Patch attached.
>>
>> This looks good to me. I have tested and don't find any issues with
>> it. Will commit in a day or so unless someone has objections.
>
> Is this fix needed in all versions that support security barrier
> views, or just in 9.5 and 9.6 that have RLS specifically?
>

It's only needed in 9.5 and later for tables with RLS, because WHERE
CURRENT OF isn't supported on views.

Regards,
Dean

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2015-07-14 19:44:10 Re: ctidscan as an example of custom-scan (Re: [v9.5] Custom Plan API)
Previous Message Alvaro Herrera 2015-07-14 19:07:09 Re: ctidscan as an example of custom-scan (Re: [v9.5] Custom Plan API)