1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-27 12:41:57 +03:00

Allow pg_dump to include/exclude child tables automatically.

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
This commit is contained in:
Tom Lane
2023-03-14 16:09:03 -04:00
parent 684ffac8c7
commit a563c24c95
3 changed files with 571 additions and 96 deletions

View File

@ -775,6 +775,19 @@ PostgreSQL documentation
</listitem>
</varlistentry>
<varlistentry>
<term><option>--exclude-table-and-children=<replaceable class="parameter">pattern</replaceable></option></term>
<listitem>
<para>
This is the same as
the <option>-T</option>/<option>--exclude-table</option> option,
except that it also excludes any partitions or inheritance child
tables of the table(s) matching the
<replaceable class="parameter">pattern</replaceable>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>--exclude-table-data=<replaceable class="parameter">pattern</replaceable></option></term>
<listitem>
@ -793,6 +806,18 @@ PostgreSQL documentation
</listitem>
</varlistentry>
<varlistentry>
<term><option>--exclude-table-data-and-children=<replaceable class="parameter">pattern</replaceable></option></term>
<listitem>
<para>
This is the same as the <option>--exclude-table-data</option> option,
except that it also excludes data of any partitions or inheritance
child tables of the table(s) matching the
<replaceable class="parameter">pattern</replaceable>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>--extra-float-digits=<replaceable class="parameter">ndigits</replaceable></option></term>
<listitem>
@ -1142,9 +1167,9 @@ PostgreSQL documentation
Require that each
extension (<option>-e</option>/<option>--extension</option>),
schema (<option>-n</option>/<option>--schema</option>) and
table (<option>-t</option>/<option>--table</option>) qualifier
table (<option>-t</option>/<option>--table</option>) 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, <application>pg_dump</application> will generate an error
even without <option>--strict-names</option>.
</para>
@ -1158,6 +1183,19 @@ PostgreSQL documentation
</listitem>
</varlistentry>
<varlistentry>
<term><option>--table-and-children=<replaceable class="parameter">pattern</replaceable></option></term>
<listitem>
<para>
This is the same as
the <option>-t</option>/<option>--table</option> option,
except that it also includes any partitions or inheritance child
tables of the table(s) matching the
<replaceable class="parameter">pattern</replaceable>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>--use-set-session-authorization</option></term>
<listitem>