Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit acea3fc

Browse files
pg_dumpall: Add --sequence-data.
I recently added this option to pg_dump, but I forgot to add it to pg_dumpall, too. There's probably little use for it at the moment, but we will need it if/when we teach pg_upgrade to use pg_dumpall to dump the database schemas. Oversight in commit 9c49f0e. Reviewed-by: Michael Paquier <[email protected]> Discussion: https://postgr.es/m/aBE8rHFo922xQUwh%40nathan
1 parent ab42d64 commit acea3fc

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

doc/src/sgml/ref/pg_dumpall.sgml

+11
Original file line numberDiff line numberDiff line change
@@ -695,6 +695,17 @@ exclude database <replaceable class="parameter">PATTERN</replaceable>
695695
</listitem>
696696
</varlistentry>
697697

698+
<varlistentry>
699+
<term><option>--sequence-data</option></term>
700+
<listitem>
701+
<para>
702+
Include sequence data in the dump. This is the default behavior except
703+
when <option>--no-data</option>, <option>--schema-only</option>, or
704+
<option>--statistics-only</option> is specified.
705+
</para>
706+
</listitem>
707+
</varlistentry>
708+
698709
<varlistentry>
699710
<term><option>--use-set-session-authorization</option></term>
700711
<listitem>

src/bin/pg_dump/pg_dumpall.c

+5
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ static int server_version;
114114
static int load_via_partition_root = 0;
115115
static int on_conflict_do_nothing = 0;
116116
static int statistics_only = 0;
117+
static int sequence_data = 0;
117118

118119
static char role_catalog[10];
119120
#define PG_AUTHID "pg_authid"
@@ -189,6 +190,7 @@ main(int argc, char *argv[])
189190
{"rows-per-insert", required_argument, NULL, 7},
190191
{"statistics-only", no_argument, &statistics_only, 1},
191192
{"filter", required_argument, NULL, 8},
193+
{"sequence-data", no_argument, &sequence_data, 1},
192194

193195
{NULL, 0, NULL, 0}
194196
};
@@ -505,6 +507,8 @@ main(int argc, char *argv[])
505507
appendPQExpBufferStr(pgdumpopts, " --on-conflict-do-nothing");
506508
if (statistics_only)
507509
appendPQExpBufferStr(pgdumpopts, " --statistics-only");
510+
if (sequence_data)
511+
appendPQExpBufferStr(pgdumpopts, " --sequence-data");
508512

509513
/*
510514
* Open the output file if required, otherwise use stdout. If required,
@@ -745,6 +749,7 @@ help(void)
745749
printf(_(" --on-conflict-do-nothing add ON CONFLICT DO NOTHING to INSERT commands\n"));
746750
printf(_(" --quote-all-identifiers quote all identifiers, even if not key words\n"));
747751
printf(_(" --rows-per-insert=NROWS number of rows per INSERT; implies --inserts\n"));
752+
printf(_(" --sequence-data include sequence data in dump\n"));
748753
printf(_(" --statistics-only dump only the statistics, not schema or data\n"));
749754
printf(_(" --use-set-session-authorization\n"
750755
" use SET SESSION AUTHORIZATION commands instead of\n"

0 commit comments

Comments
 (0)