pgsql: pg_dump, pg_dumpall, pg_restore: Add --no-policies option.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: pg_dump, pg_dumpall, pg_restore: Add --no-policies option.
Date: 2025-03-16 22:08:34
Message-ID: E1ttw9q-002pLS-2F@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

pg_dump, pg_dumpall, pg_restore: Add --no-policies option.

Add --no-policies option to control row level security policy handling
in dump and restore operations. When this option is used, both CREATE
POLICY commands and ALTER TABLE ... ENABLE ROW LEVEL SECURITY commands
are excluded from dumps and skipped during restores.

This is useful in scenarios where policies need to be redefined in the
target system or when moving data between environments with different
security requirements.

Author: Nikolay Samokhvalov <nik(at)postgres(dot)ai>
Reviewed-by: Greg Sabino Mullane <htamfids(at)gmail(dot)com>
Reviewed-by: Jim Jones <jim(dot)jones(at)uni-muenster(dot)de>
Reviewed-by: newtglobal postgresql_contributors <postgresql_contributors(at)newtglobalcorp(dot)com>
Discussion: https://postgr.es/m/CAM527d8kG2qPKvbfJ=OYJkT7iRNd623Bk+m-a4ngm+nyHYsHog@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/cd3c45125d2d92e86ad7530b162562a23d063c26

Modified Files
--------------
doc/src/sgml/ref/pg_dump.sgml | 9 +++++++++
doc/src/sgml/ref/pg_dumpall.sgml | 9 +++++++++
doc/src/sgml/ref/pg_restore.sgml | 10 ++++++++++
src/bin/pg_dump/pg_backup.h | 4 +++-
src/bin/pg_dump/pg_backup_archiver.c | 7 +++++++
src/bin/pg_dump/pg_dump.c | 8 ++++++++
src/bin/pg_dump/pg_dumpall.c | 5 +++++
src/bin/pg_dump/pg_restore.c | 4 ++++
src/bin/pg_dump/t/002_pg_dump.pl | 16 ++++++++++++++++
9 files changed, 71 insertions(+), 1 deletion(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Michael Paquier 2025-03-16 23:36:15 pgsql: Revert "Add redo LSN to pgstats files"
Previous Message Tom Lane 2025-03-16 17:46:00 pgsql: contrib/isn: Make weak mode a GUC setting, and fix related funct