pgsql: Handle policies during DROP OWNED BY

From: Stephen Frost <sfrost(at)snowman(dot)net>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Handle policies during DROP OWNED BY
Date: 2015-12-11 21:12:49
Message-ID: E1a7Uzh-0005GQ-Dw@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

Handle policies during DROP OWNED BY

DROP OWNED BY handled GRANT-based ACLs but was not removing roles from
policies. Fix that by having DROP OWNED BY remove the role specified
from the list of roles the policy (or policies) apply to, or the entire
policy (or policies) if it only applied to the role specified.

As with ACLs, the DROP OWNED BY caller must have permission to modify
the policy or a WARNING is thrown and no change is made to the policy.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/833728d4c8832f1d37e7aeaa723c8bc4045df32e

Modified Files
--------------
src/backend/catalog/pg_shdepend.c | 13 ++
src/backend/commands/policy.c | 256 +++++++++++++++++++++++++++++
src/include/commands/policy.h | 2 +
src/test/regress/expected/rowsecurity.out | 14 ++
src/test/regress/sql/rowsecurity.sql | 18 ++
5 files changed, 303 insertions(+)

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2015-12-11 21:15:23 pgsql: Install our "missing" script where PGXS builds can find it.
Previous Message Tom Lane 2015-12-11 20:53:17 pgsql: Get rid of the planner's LateralJoinInfo data structure.

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephen Frost 2015-12-11 21:31:47 Re: Remaining 9.5 open items
Previous Message Tom Lane 2015-12-11 20:57:17 Re: Remove array_nulls?