Re: RLS Design - Mailing list pgsql-hackers

From Brightwell, Adam
Subject Re: RLS Design
Date
Msg-id CAKRt6CSsPxwb2i8g2P+6NWO2GwmdCqLdTaKcYLgTZ=cDiUWjYQ@mail.gmail.com
Whole thread Raw
In response to Re: RLS Design  (Stephen Frost <sfrost@snowman.net>)
Responses Re: RLS Design  (Stephen Frost <sfrost@snowman.net>)
Re: RLS Design  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Stephen,

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)

Yes, I just tested it and the following would work from a grammar perspective:

ALTER TABLE <table_name> POLICY ADD <policy_name> (policy_quals)
ALTER TABLE <table_name> POLICY DROP <policy_name>

Though, it would obviously require the addition of POLICY to the list of unreserved keywords.  I don't suspect that would be a concern, as it is not "reserved", but thought I would point it out just in case.

Another thought I had was, would we also want the following, so that policies could be modified?

ALTER TABLE <table_name> POLICY ALTER <policy_name> (policy_quals)

Thanks,
Adam

--

pgsql-hackers by date:

Previous
From: "Brightwell, Adam"
Date:
Subject: Re: RLS Design
Next
From: Stephen Frost
Date:
Subject: Re: RLS Design