diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c index ec0cdf4ed7..c7465da33e 100644 --- a/src/bin/pg_dump/pg_dump.c +++ b/src/bin/pg_dump/pg_dump.c @@ -7253,10 +7253,11 @@ getOwnedSeqs(Archive *fout, TableInfo tblinfo[], int numTables) seqinfo->owning_tab, seqinfo->dobj.catId.oid); /* - * Only dump identity sequences if we're going to dump the table that - * it belongs to. + * Only dump identity sequences if we're going to dump the definition + * of the table that it belongs to. We ignore other components of the + * sequence. */ - if (owning_tab->dobj.dump == DUMP_COMPONENT_NONE && + if (!(owning_tab->dobj.dump == DUMP_COMPONENT_DEFINITION) && seqinfo->is_identity_sequence) { seqinfo->dobj.dump = DUMP_COMPONENT_NONE;