Re: CREATE POLICY and RETURNING - Mailing list pgsql-hackers

From Craig Ringer
Subject Re: CREATE POLICY and RETURNING
Date
Msg-id 543F5B22.40401@2ndquadrant.com
Whole thread Raw
In response to CREATE POLICY and RETURNING  (Fujii Masao <masao.fujii@gmail.com>)
Responses Re: CREATE POLICY and RETURNING
List pgsql-hackers
On 10/16/2014 12:25 PM, Fujii Masao wrote:
> Hi,
> 
> While I was checking the behavior of RLS, I found that the policy for SELECT
> doesn't seem to be applied to RETURNING. Is this intentional? 

This is why I was opposed to having a "SELECT" policy at all. It should
be "VISIBLE", "INSERT", "UPDATE", "DELETE".

I say "VISIBLE" instead of "READ" because I don't think the rows
affected by an UPDATE or DELETE should be affected by whether or not
they have a RETURNING clause. That's IMO nonsensical.and violates the
usual expectations about which clauses can have filtering effects.

So the read-filtering policy should apply to all statements. Not just
SELECT.

-- Craig Ringer                   http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training & Services



pgsql-hackers by date:

Previous
From: Rushabh Lathia
Date:
Subject: [Segmentation fault] pg_dump binary-upgrade fail for type without element
Next
From: Rushabh Lathia
Date:
Subject: Re: [Segmentation fault] pg_dump binary-upgrade fail for type without element