Re: RLS Design - Mailing list pgsql-hackers

From Stephen Frost
Subject Re: RLS Design
Date
Msg-id 20140717004958.GI16422@tamriel.snowman.net
Whole thread Raw
In response to Re: RLS Design  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: RLS Design  ("Brightwell, Adam" <adam.brightwell@crunchydatasolutions.com>)
List pgsql-hackers
Adam,

* Tom Lane (tgl@sss.pgh.pa.us) wrote:
> "Brightwell, Adam" <adam.brightwell@crunchydatasolutions.com> writes:
> >> ALTER TABLE table_name ADD POLICY policy_name (quals);
> >> ALTER TABLE table_name POLICY FOR role_name IS policy_name;
> >> ALTER TABLE table_name DROP POLICY policy_name;
[...]
> This actually isn't just bison being stupid: in fact, you simply
> cannot tell whether
>
>      ALTER TABLE tab ADD POLICY varchar(42);
>
> is an attempt to add a column named "policy" of type varchar(42), or an
> attempt to add a policy named "varchar" with quals "42".
>
> Pick a different syntax.

Yeah, now that we're trying to bake this into ALTER TABLE we need to be
a bit more cautious.  I'd think:

ALTER TABLE tab POLICY ADD ...

Would work though?  (note: haven't looked/tested myself)
Thanks!
    Stephen

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: RLS Design
Next
From: Stephen Frost
Date:
Subject: Re: Question about src/timezone/zic.c