aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Bossart <nathan@postgresql.org>2025-05-07 13:36:51 -0500
committerNathan Bossart <nathan@postgresql.org>2025-05-07 13:36:51 -0500
commitacea3fc49f006a08e6c540ac0bacc2c2577a5ff9 (patch)
treeb902b1942771498eef806195fb38ae6a0a421c7e
parentab42d643c14509cf1345588f55d798284b11a91e (diff)
downloadpostgresql-acea3fc49f006a08e6c540ac0bacc2c2577a5ff9.tar.gz
postgresql-acea3fc49f006a08e6c540ac0bacc2c2577a5ff9.zip
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 9c49f0e8cd. Reviewed-by: Michael Paquier <michael@paquier.xyz> Discussion: https://postgr.es/m/aBE8rHFo922xQUwh%40nathan
-rw-r--r--doc/src/sgml/ref/pg_dumpall.sgml11
-rw-r--r--src/bin/pg_dump/pg_dumpall.c5
2 files changed, 16 insertions, 0 deletions
diff --git a/doc/src/sgml/ref/pg_dumpall.sgml b/doc/src/sgml/ref/pg_dumpall.sgml
index 5df4b04287b..8c5141d036c 100644
--- a/doc/src/sgml/ref/pg_dumpall.sgml
+++ b/doc/src/sgml/ref/pg_dumpall.sgml
@@ -696,6 +696,17 @@ exclude database <replaceable class="parameter">PATTERN</replaceable>
</varlistentry>
<varlistentry>
+ <term><option>--sequence-data</option></term>
+ <listitem>
+ <para>
+ Include sequence data in the dump. This is the default behavior except
+ when <option>--no-data</option>, <option>--schema-only</option>, or
+ <option>--statistics-only</option> is specified.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
<term><option>--use-set-session-authorization</option></term>
<listitem>
<para>
diff --git a/src/bin/pg_dump/pg_dumpall.c b/src/bin/pg_dump/pg_dumpall.c
index 946a6d0fafc..7f9c302b719 100644
--- a/src/bin/pg_dump/pg_dumpall.c
+++ b/src/bin/pg_dump/pg_dumpall.c
@@ -114,6 +114,7 @@ static int server_version;
static int load_via_partition_root = 0;
static int on_conflict_do_nothing = 0;
static int statistics_only = 0;
+static int sequence_data = 0;
static char role_catalog[10];
#define PG_AUTHID "pg_authid"
@@ -189,6 +190,7 @@ main(int argc, char *argv[])
{"rows-per-insert", required_argument, NULL, 7},
{"statistics-only", no_argument, &statistics_only, 1},
{"filter", required_argument, NULL, 8},
+ {"sequence-data", no_argument, &sequence_data, 1},
{NULL, 0, NULL, 0}
};
@@ -505,6 +507,8 @@ main(int argc, char *argv[])
appendPQExpBufferStr(pgdumpopts, " --on-conflict-do-nothing");
if (statistics_only)
appendPQExpBufferStr(pgdumpopts, " --statistics-only");
+ if (sequence_data)
+ appendPQExpBufferStr(pgdumpopts, " --sequence-data");
/*
* Open the output file if required, otherwise use stdout. If required,
@@ -745,6 +749,7 @@ help(void)
printf(_(" --on-conflict-do-nothing add ON CONFLICT DO NOTHING to INSERT commands\n"));
printf(_(" --quote-all-identifiers quote all identifiers, even if not key words\n"));
printf(_(" --rows-per-insert=NROWS number of rows per INSERT; implies --inserts\n"));
+ printf(_(" --sequence-data include sequence data in dump\n"));
printf(_(" --statistics-only dump only the statistics, not schema or data\n"));
printf(_(" --use-set-session-authorization\n"
" use SET SESSION AUTHORIZATION commands instead of\n"