From a563c24c9574b74f4883c004c89275bba03c3c26 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Tue, 14 Mar 2023 16:09:03 -0400 Subject: Allow pg_dump to include/exclude child tables automatically. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch adds new pg_dump switches --table-and-children=pattern --exclude-table-and-children=pattern --exclude-table-data-and-children=pattern which act the same as the existing --table, --exclude-table, and --exclude-table-data switches, except that any partitions or inheritance child tables of the table(s) matching the pattern are also included or excluded. Gilles Darold, reviewed by Stéphane Tachoires Discussion: https://postgr.es/m/5aa393b5-5f67-8447-b83e-544516990ee2@migops.com --- doc/src/sgml/ref/pg_dump.sgml | 42 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 40 insertions(+), 2 deletions(-) (limited to 'doc/src') diff --git a/doc/src/sgml/ref/pg_dump.sgml b/doc/src/sgml/ref/pg_dump.sgml index 334e4b7fd14..e6b003bf104 100644 --- a/doc/src/sgml/ref/pg_dump.sgml +++ b/doc/src/sgml/ref/pg_dump.sgml @@ -775,6 +775,19 @@ PostgreSQL documentation + + + + + This is the same as + the / option, + except that it also excludes any partitions or inheritance child + tables of the table(s) matching the + pattern. + + + + @@ -793,6 +806,18 @@ PostgreSQL documentation + + + + + This is the same as the option, + except that it also excludes data of any partitions or inheritance + child tables of the table(s) matching the + pattern. + + + + @@ -1142,9 +1167,9 @@ PostgreSQL documentation Require that each extension (/), schema (/) and - table (/) qualifier + table (/) pattern match at least one extension/schema/table in the database to be dumped. - Note that if none of the extension/schema/table qualifiers find + Note that if none of the extension/schema/table patterns find matches, pg_dump will generate an error even without . @@ -1158,6 +1183,19 @@ PostgreSQL documentation + + + + + This is the same as + the / option, + except that it also includes any partitions or inheritance child + tables of the table(s) matching the + pattern. + + + + -- cgit v1.2.3