diff options
author | Michael Paquier <michael@paquier.xyz> | 2021-03-31 09:12:34 +0900 |
---|---|---|
committer | Michael Paquier <michael@paquier.xyz> | 2021-03-31 09:12:34 +0900 |
commit | 6568cef26e0f40c25ae54b8e20aad8d1410a854b (patch) | |
tree | 406b7986ec4939efef7ae24712dc0df5be1cadc8 /doc/src | |
parent | 65158f497a7d7523ad438b2034d01a560fafe6bd (diff) | |
download | postgresql-6568cef26e0f40c25ae54b8e20aad8d1410a854b.tar.gz postgresql-6568cef26e0f40c25ae54b8e20aad8d1410a854b.zip |
Add support for --extension in pg_dump
When specified, only extensions matching the given pattern are included
in dumps. Similarly to --table and --schema, when --strict-names is
used, a perfect match is required. Also, like the two other options,
this new option offers no guarantee that dependent objects have been
dumped, so a restore may fail on a clean database.
Tests are added in test_pg_dump/, checking after a set of positive and
negative cases, with or without an extension's contents added to the
dump generated.
Author: Guillaume Lelarge
Reviewed-by: David Fetter, Tom Lane, Michael Paquier, Asif Rehman,
Julien Rouhaud
Discussion: https://postgr.es/m/CAECtzeXOt4cnMU5+XMZzxBPJ_wu76pNy6HZKPRBL-j7yj1E4+g@mail.gmail.com
Diffstat (limited to 'doc/src')
-rw-r--r-- | doc/src/sgml/ref/pg_dump.sgml | 43 |
1 files changed, 38 insertions, 5 deletions
diff --git a/doc/src/sgml/ref/pg_dump.sgml b/doc/src/sgml/ref/pg_dump.sgml index 989b8e23815..529b167c969 100644 --- a/doc/src/sgml/ref/pg_dump.sgml +++ b/doc/src/sgml/ref/pg_dump.sgml @@ -216,6 +216,38 @@ PostgreSQL documentation </varlistentry> <varlistentry> + <term><option>-e <replaceable class="parameter">pattern</replaceable></option></term> + <term><option>--extension=<replaceable class="parameter">pattern</replaceable></option></term> + <listitem> + <para> + Dump only extensions matching <replaceable + class="parameter">pattern</replaceable>. When this option is not + specified, all non-system extensions in the target database will be + dumped. Multiple extensions can be selected by writing multiple + <option>-e</option> switches. The <replaceable + class="parameter">pattern</replaceable> parameter is interpreted as a + pattern according to the same rules used by + <application>psql</application>'s <literal>\d</literal> commands (see + <xref linkend="app-psql-patterns"/>), so multiple extensions can also + be selected by writing wildcard characters in the pattern. When using + wildcards, be careful to quote the pattern if needed to prevent the + shell from expanding the wildcards. + </para> + + <note> + <para> + When <option>-e</option> is specified, + <application>pg_dump</application> makes no attempt to dump any other + database objects that the selected extension(s) might depend upon. + Therefore, there is no guarantee that the results of a + specific-extension dump can be successfully restored by themselves + into a clean database. + </para> + </note> + </listitem> + </varlistentry> + + <varlistentry> <term><option>-E <replaceable class="parameter">encoding</replaceable></option></term> <term><option>--encoding=<replaceable class="parameter">encoding</replaceable></option></term> <listitem> @@ -1079,11 +1111,12 @@ PostgreSQL documentation <term><option>--strict-names</option></term> <listitem> <para> - Require that each schema - (<option>-n</option>/<option>--schema</option>) and table - (<option>-t</option>/<option>--table</option>) qualifier match at - least one schema/table in the database to be dumped. Note that if - none of the schema/table qualifiers find + 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 + match at least one extension/schema/table in the database to be dumped. + Note that if none of the extension/schema/table qualifiers find matches, <application>pg_dump</application> will generate an error even without <option>--strict-names</option>. </para> |