-
- Downloads
Disallow converting a table to a view if row security is present.
When DefineQueryRewrite() is about to convert a table to a view, it checks the table for features unavailable to views. For example, it rejects tables having triggers. It omits to reject tables having relrowsecurity or a pg_policy record. Fix that. To faciliate the repair, invent relation_has_policies() which indicates the presence of policies on a relation even when row security is disabled for that relation. Reported by Noah Misch. Patch by me, review by Stephen Frost. Back-patch to 9.5 where RLS was introduced.
Showing
- src/backend/commands/policy.c 29 additions, 0 deletionssrc/backend/commands/policy.c
- src/backend/rewrite/rewriteDefine.c 19 additions, 5 deletionssrc/backend/rewrite/rewriteDefine.c
- src/include/commands/policy.h 1 addition, 0 deletionssrc/include/commands/policy.h
- src/test/regress/expected/rowsecurity.out 23 additions, 0 deletionssrc/test/regress/expected/rowsecurity.out
- src/test/regress/sql/rowsecurity.sql 25 additions, 0 deletionssrc/test/regress/sql/rowsecurity.sql
Loading
Please register or sign in to comment