From cd3c45125d2d92e86ad7530b162562a23d063c26 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sun, 16 Mar 2025 18:08:15 -0400 Subject: 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 Reviewed-by: Greg Sabino Mullane Reviewed-by: Jim Jones Reviewed-by: newtglobal postgresql_contributors Discussion: https://postgr.es/m/CAM527d8kG2qPKvbfJ=OYJkT7iRNd623Bk+m-a4ngm+nyHYsHog@mail.gmail.com --- doc/src/sgml/ref/pg_dump.sgml | 9 +++++++++ doc/src/sgml/ref/pg_dumpall.sgml | 9 +++++++++ doc/src/sgml/ref/pg_restore.sgml | 10 ++++++++++ 3 files changed, 28 insertions(+) (limited to 'doc/src') diff --git a/doc/src/sgml/ref/pg_dump.sgml b/doc/src/sgml/ref/pg_dump.sgml index 1975054d7bf..0ae40f9be58 100644 --- a/doc/src/sgml/ref/pg_dump.sgml +++ b/doc/src/sgml/ref/pg_dump.sgml @@ -1105,6 +1105,15 @@ PostgreSQL documentation + + + + + Do not dump row security policies. + + + + diff --git a/doc/src/sgml/ref/pg_dumpall.sgml b/doc/src/sgml/ref/pg_dumpall.sgml index c2fa5be9519..ae5afb3c7d5 100644 --- a/doc/src/sgml/ref/pg_dumpall.sgml +++ b/doc/src/sgml/ref/pg_dumpall.sgml @@ -441,6 +441,15 @@ exclude database PATTERN + + + + + Do not dump row security policies. + + + + diff --git a/doc/src/sgml/ref/pg_restore.sgml b/doc/src/sgml/ref/pg_restore.sgml index 199ea3345f3..35140187807 100644 --- a/doc/src/sgml/ref/pg_restore.sgml +++ b/doc/src/sgml/ref/pg_restore.sgml @@ -723,6 +723,16 @@ PostgreSQL documentation + + + + + Do not output commands to restore row security policies, even if + the archive contains them. + + + + -- cgit v1.2.3