]> granicus.if.org Git - postgresql/commit
Handle dependencies properly in ALTER POLICY
authorStephen Frost <sfrost@snowman.net>
Fri, 11 Dec 2015 20:43:03 +0000 (15:43 -0500)
committerStephen Frost <sfrost@snowman.net>
Fri, 11 Dec 2015 20:43:03 +0000 (15:43 -0500)
commited8bec915ec570bd90d86710392fe0c181fd08fe
treede99dcc1ce2380c481ec1a36358d5ab607d6b0ec
parentacfcd45cacb6df23edba4cb3753a2be594238a99
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