aboutsummaryrefslogtreecommitdiff
path: root/src/backend/rewrite/rewriteHandler.c
diff options
context:
space:
mode:
authorJoe Conway <mail@joeconway.com>2017-06-11 08:51:18 -0700
committerJoe Conway <mail@joeconway.com>2017-06-11 08:51:18 -0700
commit4f7a95be2c112bdc8da5f7e46cbb743b8ba4cc21 (patch)
tree08cd6ef86fc2e31b8c39b459ad001c39d717c659 /src/backend/rewrite/rewriteHandler.c
parent93b7d9731f184e764c642266ecd74be24db73a6e (diff)
downloadpostgresql-4f7a95be2c112bdc8da5f7e46cbb743b8ba4cc21.tar.gz
postgresql-4f7a95be2c112bdc8da5f7e46cbb743b8ba4cc21.zip
Apply RLS policies to partitioned tables.
The new partitioned table capability added a new relkind, namely RELKIND_PARTITIONED_TABLE. Update fireRIRrules() to apply RLS policies on RELKIND_PARTITIONED_TABLE as it does RELKIND_RELATION. In addition, add RLS regression test coverage for partitioned tables. Issue raised by Fakhroutdinov Evgenievich and patch by Mike Palmiotto. Regression test editorializing by me. Discussion: https://postgr.es/m/flat/20170601065959.1486.69906@wrigleys.postgresql.org
Diffstat (limited to 'src/backend/rewrite/rewriteHandler.c')
-rw-r--r--src/backend/rewrite/rewriteHandler.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/backend/rewrite/rewriteHandler.c b/src/backend/rewrite/rewriteHandler.c
index 35ff8bb3b7c..6cd73c13868 100644
--- a/src/backend/rewrite/rewriteHandler.c
+++ b/src/backend/rewrite/rewriteHandler.c
@@ -1835,7 +1835,8 @@ fireRIRrules(Query *parsetree, List *activeRIRs, bool forUpdatePushedDown)
/* Only normal relations can have RLS policies */
if (rte->rtekind != RTE_RELATION ||
- rte->relkind != RELKIND_RELATION)
+ (rte->relkind != RELKIND_RELATION &&
+ rte->relkind != RELKIND_PARTITIONED_TABLE))
continue;
rel = heap_open(rte->relid, NoLock);