mirror of
https://github.com/postgres/postgres.git
synced 2025-07-15 19:21:59 +03:00
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
This commit is contained in:
@ -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);
|
||||
|
Reference in New Issue
Block a user