Skip to content

Commit 4f7a95b

Browse files
committed
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
1 parent 93b7d97 commit 4f7a95b

File tree

3 files changed

+572
-1
lines changed

3 files changed

+572
-1
lines changed

src/backend/rewrite/rewriteHandler.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1835,7 +1835,8 @@ fireRIRrules(Query *parsetree, List *activeRIRs, bool forUpdatePushedDown)
18351835

18361836
/* Only normal relations can have RLS policies */
18371837
if (rte->rtekind != RTE_RELATION ||
1838-
rte->relkind != RELKIND_RELATION)
1838+
(rte->relkind != RELKIND_RELATION &&
1839+
rte->relkind != RELKIND_PARTITIONED_TABLE))
18391840
continue;
18401841

18411842
rel = heap_open(rte->relid, NoLock);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy