Apply RLS policies to partitioned tables

Enterprise / PostgreSQL - Joe Conway [joeconway.com] - 11 June 2017 11:51 EDT

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

4f7a95b Apply RLS policies to partitioned tables.
src/backend/rewrite/rewriteHandler.c | 3 +-
src/test/regress/expected/rowsecurity.out | 428 ++++++++++++++++++++++++++++++
src/test/regress/sql/rowsecurity.sql | 142 ++++++++++
3 files changed, 572 insertions(+), 1 deletion(-)

Upstream: git.postgresql.org


  • Share