</listitem>
</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>--serializable-deferrable</option></term>
<listitem>
{"sync-method", required_argument, NULL, 15},
{"filter", required_argument, NULL, 16},
{"exclude-extension", required_argument, NULL, 17},
+ {"sequence-data", no_argument, &dopt.sequence_data, 1},
{NULL, 0, NULL, 0}
};
if (dopt.column_inserts && dopt.dump_inserts == 0)
dopt.dump_inserts = DUMP_DEFAULT_ROWS_PER_INSERT;
- /*
- * Binary upgrade mode implies dumping sequence data even in schema-only
- * mode. This is not exposed as a separate option, but kept separate
- * internally for clarity.
- */
- if (dopt.binary_upgrade)
- dopt.sequence_data = 1;
-
if (data_only && schema_only)
pg_fatal("options -s/--schema-only and -a/--data-only cannot be used together");
if (schema_only && statistics_only)
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(_(" --section=SECTION dump named section (pre-data, data, or post-data)\n"));
+ printf(_(" --sequence-data include sequence data in dump\n"));
printf(_(" --serializable-deferrable wait until the dump can run without anomalies\n"));
printf(_(" --snapshot=SNAPSHOT use given snapshot for the dump\n"));
printf(_(" --statistics-only dump only the statistics, not schema or data\n"));
snprintf(log_file_name, sizeof(log_file_name), DB_DUMP_LOG_FILE_MASK, old_db->db_oid);
parallel_exec_prog(log_file_name, NULL,
- "\"%s/pg_dump\" %s --no-data %s --quote-all-identifiers "
+ "\"%s/pg_dump\" %s --no-data %s --sequence-data --quote-all-identifiers "
"--binary-upgrade --format=custom %s --no-sync --file=\"%s/%s\" %s",
new_cluster.bindir, cluster_conn_opts(&old_cluster),
log_opts.verbose ? "--verbose" : "",
dump_cmd => [
'pg_dump', '--no-sync',
'--file' => "$tempdir/binary_upgrade.sql",
- '--schema-only', '--binary-upgrade',
+ '--schema-only', '--sequence-data', '--binary-upgrade',
'--dbname' => 'postgres',
],
},