pgsql: Handle dependencies properly in ALTER POLICY

From: Stephen Frost <sfrost(at)snowman(dot)net>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Handle dependencies properly in ALTER POLICY
Date: 2015-12-11 20:44:21
Message-ID: E1a7UY9-0004kV-SJ@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Handle dependencies properly in ALTER POLICY

ALTER POLICY hadn't fully considered partial policy alternation
(eg: change just the roles on the policy, or just change one of
the expressions) when rebuilding the dependencies. Instead, it
would happily remove all dependencies which existed for the
policy and then only recreate the dependencies for the objects
referred to in the specific ALTER POLICY command.

Correct that by extracting and building the dependencies for all
objects referenced by the policy, regardless of if they were
provided as part of the ALTER POLICY command or were already in
place as part of the pre-existing policy.

Branch
------
REL9_5_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/12a54c888cf7bd9c37c4ce420e84cb52debe0184

Modified Files
--------------
src/backend/commands/policy.c | 97 +++++++++++++++++++++++++++++
src/test/regress/expected/rowsecurity.out | 43 +++++++++++++
src/test/regress/sql/rowsecurity.sql | 31 +++++++++
3 files changed, 171 insertions(+)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2015-12-11 20:53:17 pgsql: Get rid of the planner's LateralJoinInfo data structure.
Previous Message Tom Lane 2015-12-11 19:22:36 pgsql: Still more fixes for planner's handling of LATERAL references.