]> granicus.if.org Git - postgresql/commit
Handle dependencies properly in ALTER POLICY
authorStephen Frost <sfrost@snowman.net>
Fri, 11 Dec 2015 20:44:03 +0000 (15:44 -0500)
committerStephen Frost <sfrost@snowman.net>
Fri, 11 Dec 2015 20:44:03 +0000 (15:44 -0500)
commit12a54c888cf7bd9c37c4ce420e84cb52debe0184
treedd25754a6cef58c4142041eef13b77e5a972f211
parent564c19e86eff3f2221471e60a963d55bd5f76954
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.
src/backend/commands/policy.c
src/test/regress/expected/rowsecurity.out
src/test/regress/sql/rowsecurity.sql