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

Add "--exclude-extension" to pg_dump's options.

This option (or equivalently specifying "exclude extension pattern" in
a filter file) allows extensions matching the specified pattern to be
excluded from the dump.

Ayush Vatsa, reviewed by Junwang Zhao, Dean Rasheed, and Daniel
Gustafsson.

Discussion: https://postgr.es/m/CACX+KaP=VgVy9h-EUh598DTu+-fNr1jyEmpghC8rRp9s=w33Kg@mail.gmail.com
This commit is contained in:
Dean Rasheed
2024-03-20 08:05:44 +00:00
parent d63d486d6c
commit 522ed12f7c
3 changed files with 139 additions and 16 deletions

View File

@ -256,6 +256,27 @@ PostgreSQL documentation
</listitem>
</varlistentry>
<varlistentry>
<term><option>--exclude-extension=<replaceable class="parameter">pattern</replaceable></option></term>
<listitem>
<para>
Do not dump any extensions matching <replaceable
class="parameter">pattern</replaceable>. The pattern is
interpreted according to the same rules as for <option>-e</option>.
<option>--exclude-extension</option> can be given more than once to exclude extensions
matching any of several patterns.
</para>
<para>
When both <option>-e</option> and <option>--exclude-extension</option> are given, the behavior
is to dump just the extensions that match at least one <option>-e</option>
switch but no <option>--exclude-extension</option> switches. If <option>--exclude-extension</option>
appears without <option>-e</option>, then extensions matching <option>--exclude-extension</option> are
excluded from what is otherwise a normal dump.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-E <replaceable class="parameter">encoding</replaceable></option></term>
<term><option>--encoding=<replaceable class="parameter">encoding</replaceable></option></term>
@ -848,10 +869,11 @@ PostgreSQL documentation
<option>--exclude-table-and-children</option> or
<option>-T</option> for tables,
<option>-n</option>/<option>--schema</option> for schemas,
<option>--include-foreign-data</option> for data on foreign servers and
<option>--include-foreign-data</option> for data on foreign servers,
<option>--exclude-table-data</option>,
<option>--exclude-table-data-and-children</option> for table data,
<option>-e</option>/<option>--extension</option> for extensions.
<option>--exclude-table-data-and-children</option> for table data, and
<option>-e</option>/<option>--extension</option> or
<option>--exclude-extension</option> for extensions.
To read from <literal>STDIN</literal>, use <filename>-</filename> as the
filename. The <option>--filter</option> option can be specified in
conjunction with the above listed options for including or excluding
@ -874,8 +896,7 @@ PostgreSQL documentation
<listitem>
<para>
<literal>extension</literal>: extensions, works like the
<option>--extension</option> option. This keyword can only be
used with the <literal>include</literal> keyword.
<option>-e</option>/<option>--extension</option> option.
</para>
</listitem>
<listitem>
@ -1278,7 +1299,8 @@ PostgreSQL documentation
</para>
<para>
This option has no effect
on <option>-N</option>/<option>--exclude-schema</option>,
on <option>--exclude-extension</option>,
<option>-N</option>/<option>--exclude-schema</option>,
<option>-T</option>/<option>--exclude-table</option>,
or <option>--exclude-table-data</option>. An exclude pattern failing
to match any objects is not considered an error.