]> granicus.if.org Git - postgresql/commit
Handle policies during DROP OWNED BY
authorStephen Frost <sfrost@snowman.net>
Fri, 11 Dec 2015 21:12:36 +0000 (16:12 -0500)
committerStephen Frost <sfrost@snowman.net>
Fri, 11 Dec 2015 21:12:36 +0000 (16:12 -0500)
commitfda18e46a65196b98d6ca4ce4911085b0d2f182f
treec490ad032a3aaa7fcd02e368143a59fab4f0719e
parentdc4518814ecc2ae319c4d1679ee079e47dbd78e9
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.
src/backend/catalog/pg_shdepend.c
src/backend/commands/policy.c
src/include/commands/policy.h
src/test/regress/expected/rowsecurity.out
src/test/regress/sql/rowsecurity.sql