Re: BUG #13780: Multiple commands not allowed for creating a policy. - Mailing list pgsql-bugs

From Caleb Meredith
Subject Re: BUG #13780: Multiple commands not allowed for creating a policy.
Date
Msg-id CABFpK62sDdQBMwM59tmnPOZ9+SMdWakSXk3NvcvAytd0FbS4OA@mail.gmail.com
Whole thread Raw
In response to Re: BUG #13780: Multiple commands not allowed for creating a policy.  (Stephen Frost <sfrost@snowman.net>)
List pgsql-bugs
My use case is I want users to see more data then they can edit. So select
would have a broad USAGE clause and the write commands (insert, update,
delete) would have a narrow USAGE/WITH CLAUSE check.
On Mon, Nov 23, 2015 at 9:59 AM Stephen Frost <sfrost@snowman.net> wrote:

> Michael,
>
> * Michael Paquier (michael.paquier@gmail.com) wrote:
> > On Sun, Nov 22, 2015 at 10:23 PM, <calebmeredith8@gmail.com> wrote:
> > > This doesn't seem to be intended as the GRANT specification allows it,
> and
> > > CREATE POLICY supports the ALL command.
> >
> > Yeah, I would tend to agree that the existence of ALL contradicts the
> > expression constraints that are in place when defining a non-ALL policy
> as
> > we could basically ignore either the WITH CHECK or USING clauses defined
> in
> > a policy defined depending on the DML or SELECT command used. To be more
> > exact, for example with an ALL policy that has both a WITH CHECK and
> USING
> > defined, we would ignore the USING clause with an INSERT query, right? We
> > are in beta2 state now, so I don't think anything is going to change, but
> > Stephen, your thoughts perhaps?
>
> We could support allowing multiple commands for a policy and would just
> need to adjust the checks to make sure that the policy definition makes
> sense, but that's all new-feature type of work which would be for 9.6
> and not a bug in the current implementation.  I'm certainly not against
> doing that, but it doesn't seem like a terribly high priority.
>
> Thanks!
>
> Stephen
>

pgsql-bugs by date:

Previous
From: Stephen Frost
Date:
Subject: Re: BUG #13780: Multiple commands not allowed for creating a policy.
Next
From: zsolt.sandor@gmail.com
Date:
Subject: BUG #13781: "unrecognized node type" errors