Skip to content

Commit 10f5544

Browse files
committed
Clarify pg_dump documentation
Clarify in the help output and documentation that -n, -t etc. take a "pattern" rather than a "schema" or "table" etc. This was especially confusing now that the new pg_dumpall --exclude-database option was documented with "pattern" and the others not, even though they all behave the same. Discussion: https://www.postgresql.org/message-id/flat/b85f3fa1-b350-38d1-1893-4f7911bd7310%402ndquadrant.com
1 parent bde8c2d commit 10f5544

File tree

2 files changed

+26
-26
lines changed

2 files changed

+26
-26
lines changed

doc/src/sgml/ref/pg_dump.sgml

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -375,17 +375,17 @@ PostgreSQL documentation
375375
</varlistentry>
376376

377377
<varlistentry>
378-
<term><option>-n <replaceable class="parameter">schema</replaceable></option></term>
379-
<term><option>--schema=<replaceable class="parameter">schema</replaceable></option></term>
378+
<term><option>-n <replaceable class="parameter">pattern</replaceable></option></term>
379+
<term><option>--schema=<replaceable class="parameter">pattern</replaceable></option></term>
380380
<listitem>
381381
<para>
382382
Dump only schemas matching <replaceable
383-
class="parameter">schema</replaceable>; this selects both the
383+
class="parameter">pattern</replaceable>; this selects both the
384384
schema itself, and all its contained objects. When this option is
385385
not specified, all non-system schemas in the target database will be
386386
dumped. Multiple schemas can be
387-
selected by writing multiple <option>-n</option> switches. Also, the
388-
<replaceable class="parameter">schema</replaceable> parameter is
387+
selected by writing multiple <option>-n</option> switches. The
388+
<replaceable class="parameter">pattern</replaceable> parameter is
389389
interpreted as a pattern according to the same rules used by
390390
<application>psql</application>'s <literal>\d</literal> commands (see <xref
391391
linkend="app-psql-patterns" endterm="app-psql-patterns-title"/>),
@@ -417,12 +417,12 @@ PostgreSQL documentation
417417
</varlistentry>
418418

419419
<varlistentry>
420-
<term><option>-N <replaceable class="parameter">schema</replaceable></option></term>
421-
<term><option>--exclude-schema=<replaceable class="parameter">schema</replaceable></option></term>
420+
<term><option>-N <replaceable class="parameter">pattern</replaceable></option></term>
421+
<term><option>--exclude-schema=<replaceable class="parameter">pattern</replaceable></option></term>
422422
<listitem>
423423
<para>
424-
Do not dump any schemas matching the <replaceable
425-
class="parameter">schema</replaceable> pattern. The pattern is
424+
Do not dump any schemas matching <replaceable
425+
class="parameter">pattern</replaceable>. The pattern is
426426
interpreted according to the same rules as for <option>-n</option>.
427427
<option>-N</option> can be given more than once to exclude schemas
428428
matching any of several patterns.
@@ -513,16 +513,16 @@ PostgreSQL documentation
513513
</varlistentry>
514514

515515
<varlistentry>
516-
<term><option>-t <replaceable class="parameter">table</replaceable></option></term>
517-
<term><option>--table=<replaceable class="parameter">table</replaceable></option></term>
516+
<term><option>-t <replaceable class="parameter">pattern</replaceable></option></term>
517+
<term><option>--table=<replaceable class="parameter">pattern</replaceable></option></term>
518518
<listitem>
519519
<para>
520520
Dump only tables with names matching
521-
<replaceable class="parameter">table</replaceable>.
521+
<replaceable class="parameter">pattern</replaceable>.
522522
For this purpose, <quote>table</quote> includes views, materialized views,
523523
sequences, and foreign tables. Multiple tables
524-
can be selected by writing multiple <option>-t</option> switches. Also, the
525-
<replaceable class="parameter">table</replaceable> parameter is
524+
can be selected by writing multiple <option>-t</option> switches. The
525+
<replaceable class="parameter">pattern</replaceable> parameter is
526526
interpreted as a pattern according to the same rules used by
527527
<application>psql</application>'s <literal>\d</literal> commands (see <xref
528528
linkend="app-psql-patterns" endterm="app-psql-patterns-title"/>),
@@ -565,12 +565,12 @@ PostgreSQL documentation
565565
</varlistentry>
566566

567567
<varlistentry>
568-
<term><option>-T <replaceable class="parameter">table</replaceable></option></term>
569-
<term><option>--exclude-table=<replaceable class="parameter">table</replaceable></option></term>
568+
<term><option>-T <replaceable class="parameter">pattern</replaceable></option></term>
569+
<term><option>--exclude-table=<replaceable class="parameter">pattern</replaceable></option></term>
570570
<listitem>
571571
<para>
572-
Do not dump any tables matching the <replaceable
573-
class="parameter">table</replaceable> pattern. The pattern is
572+
Do not dump any tables matching <replaceable
573+
class="parameter">pattern</replaceable>. The pattern is
574574
interpreted according to the same rules as for <option>-t</option>.
575575
<option>-T</option> can be given more than once to exclude tables
576576
matching any of several patterns.
@@ -728,11 +728,11 @@ PostgreSQL documentation
728728
</varlistentry>
729729

730730
<varlistentry>
731-
<term><option>--exclude-table-data=<replaceable class="parameter">table</replaceable></option></term>
731+
<term><option>--exclude-table-data=<replaceable class="parameter">pattern</replaceable></option></term>
732732
<listitem>
733733
<para>
734-
Do not dump data for any tables matching the <replaceable
735-
class="parameter">table</replaceable> pattern. The pattern is
734+
Do not dump data for any tables matching <replaceable
735+
class="parameter">pattern</replaceable>. The pattern is
736736
interpreted according to the same rules as for <option>-t</option>.
737737
<option>--exclude-table-data</option> can be given more than once to
738738
exclude tables matching any of several patterns. This option is

src/bin/pg_dump/pg_dump.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1000,22 +1000,22 @@ help(const char *progname)
10001000
printf(_(" -c, --clean clean (drop) database objects before recreating\n"));
10011001
printf(_(" -C, --create include commands to create database in dump\n"));
10021002
printf(_(" -E, --encoding=ENCODING dump the data in encoding ENCODING\n"));
1003-
printf(_(" -n, --schema=SCHEMA dump the named schema(s) only\n"));
1004-
printf(_(" -N, --exclude-schema=SCHEMA do NOT dump the named schema(s)\n"));
1003+
printf(_(" -n, --schema=PATTERN dump the specified schema(s) only\n"));
1004+
printf(_(" -N, --exclude-schema=PATTERN do NOT dump the specified schema(s)\n"));
10051005
printf(_(" -O, --no-owner skip restoration of object ownership in\n"
10061006
" plain-text format\n"));
10071007
printf(_(" -s, --schema-only dump only the schema, no data\n"));
10081008
printf(_(" -S, --superuser=NAME superuser user name to use in plain-text format\n"));
1009-
printf(_(" -t, --table=TABLE dump the named table(s) only\n"));
1010-
printf(_(" -T, --exclude-table=TABLE do NOT dump the named table(s)\n"));
1009+
printf(_(" -t, --table=PATTERN dump the specified table(s) only\n"));
1010+
printf(_(" -T, --exclude-table=PATTERN do NOT dump the specified table(s)\n"));
10111011
printf(_(" -x, --no-privileges do not dump privileges (grant/revoke)\n"));
10121012
printf(_(" --binary-upgrade for use by upgrade utilities only\n"));
10131013
printf(_(" --column-inserts dump data as INSERT commands with column names\n"));
10141014
printf(_(" --disable-dollar-quoting disable dollar quoting, use SQL standard quoting\n"));
10151015
printf(_(" --disable-triggers disable triggers during data-only restore\n"));
10161016
printf(_(" --enable-row-security enable row security (dump only content user has\n"
10171017
" access to)\n"));
1018-
printf(_(" --exclude-table-data=TABLE do NOT dump data for the named table(s)\n"));
1018+
printf(_(" --exclude-table-data=PATTERN do NOT dump data for the specified table(s)\n"));
10191019
printf(_(" --extra-float-digits=NUM override default setting for extra_float_digits\n"));
10201020
printf(_(" --if-exists use IF EXISTS when dropping objects\n"));
10211021
printf(_(" --inserts dump data as INSERT commands, rather than COPY\n"));

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy