Re: CREATE POLICY bug ? - Mailing list pgsql-hackers

From Dean Rasheed
Subject Re: CREATE POLICY bug ?
Date
Msg-id CAEZATCXA27WT6pr4HX5b_-rqSLQgbXC31fjDZ++9VJjTFncC9w@mail.gmail.com
Whole thread Raw
In response to CREATE POLICY bug ?  (Andrea Adami <fol@fulcro.net>)
Responses Re: CREATE POLICY bug ?  (Dean Rasheed <dean.a.rasheed@gmail.com>)
List pgsql-hackers
On 20 August 2016 at 03:15, Andrea Adami <fol@fulcro.net> wrote:
> when i run the query: "select * from public.policy_view"
> the ouput is the same (all rows)  for all users
> i'm doing some mistakes or this is a bug ?
>

No, it looks correct to me. When going through a view, the policies
and permission checks that apply are those that would apply to the
view's owner, which in this case is postgres, so no policies are
applied.

Or, quoting from the notes in the CREATE POLICY documentation:
   As with normal queries and views, permission checks and policies for   the tables which are referenced by a view
willuse the view owner's   rights and any policies which apply to the view owner.
 

Regards,
Dean



pgsql-hackers by date:

Previous
From: Craig Ringer
Date:
Subject: Re: Logical decoding slots can go backwards when used from SQL, docs are wrong
Next
From: Petr Jelinek
Date:
Subject: Re: Logical decoding slots can go backwards when used from SQL, docs are wrong