Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit4ed59e0

Browse files
committed
Do not dump identity sequences with excluded parent table
This commit prevents a crash of pg_dump caused by the exclusion of atable which has identity columns, as the table would be correctlyexcluded but not its identity sequence. In order to fix that, identitysequences are excluded if the parent table is defined as such. Knowingabout such sequences has no meaning without their parent table anyway.Reported-by: Andy AbelistoAuthor: David RowleyReviewed-by: Peter Eisentraut, Michael PaquierDiscussion:https://postgr.es/m/153479393218.1316.8472285660264976457@wrigleys.postgresql.orgBackpatch-through: 10
1 parent561a5ab commit4ed59e0

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

‎src/bin/pg_dump/pg_dump.c

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6627,8 +6627,20 @@ getOwnedSeqs(Archive *fout, TableInfo tblinfo[], int numTables)
66276627
seqinfo->owning_tab, seqinfo->dobj.catId.oid);
66286628

66296629
/*
6630-
* We need to dump the components that are being dumped for the table
6631-
* and any components which the sequence is explicitly marked with.
6630+
* Only dump identity sequences if we're going to dump the table that
6631+
* it belongs to.
6632+
*/
6633+
if (owning_tab->dobj.dump == DUMP_COMPONENT_NONE &&
6634+
seqinfo->is_identity_sequence)
6635+
{
6636+
seqinfo->dobj.dump = DUMP_COMPONENT_NONE;
6637+
continue;
6638+
}
6639+
6640+
/*
6641+
* Otherwise we need to dump the components that are being dumped for
6642+
* the table and any components which the sequence is explicitly
6643+
* marked with.
66326644
*
66336645
* We can't simply use the set of components which are being dumped
66346646
* for the table as the table might be in an extension (and only the

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp