]> git.ipfire.org Git - thirdparty/postgresql.git/commit
RLS refactoring
authorStephen Frost <sfrost@snowman.net>
Tue, 15 Sep 2015 19:49:40 +0000 (15:49 -0400)
committerStephen Frost <sfrost@snowman.net>
Tue, 15 Sep 2015 19:49:40 +0000 (15:49 -0400)
commit23a4b897f731e1a2be7fe989a34016d7a6287148
tree0fadf580ab43634f6e9498dd54687e860eb01fa4
parented301d6dbe32eaad4f226903d430336e5a0d72aa
RLS refactoring

This refactors rewrite/rowsecurity.c to simplify the handling of the
default deny case (reducing the number of places where we check for and
add the default deny policy from three to one) by splitting up the
retrival of the policies from the application of them.

This also allowed us to do away with the policy_id field.  A policy_name
field was added for WithCheckOption policies and is used in error
reporting, when available.

Patch by Dean Rasheed, with various mostly cosmetic changes by me.

Back-patch to 9.5 where RLS was introduced to avoid unnecessary
differences, since we're still in alpha, per discussion with Robert.
13 files changed:
src/backend/commands/policy.c
src/backend/executor/execMain.c
src/backend/nodes/copyfuncs.c
src/backend/nodes/equalfuncs.c
src/backend/nodes/outfuncs.c
src/backend/nodes/readfuncs.c
src/backend/rewrite/rewriteHandler.c
src/backend/rewrite/rowsecurity.c
src/backend/utils/cache/relcache.c
src/include/nodes/parsenodes.h
src/include/rewrite/rowsecurity.h
src/test/modules/test_rls_hooks/expected/test_rls_hooks.out
src/test/modules/test_rls_hooks/test_rls_hooks.c