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

Commit683abc7

Browse files
committed
Ignore invalid indexes in pg_dump.
Dumping invalid indexes can cause problems at restore time, for exampleif the reason the index creation failed was because it tried to enforcea uniqueness condition not satisfied by the table's data. Also, if theindex creation is in fact still in progress, it seems reasonable toconsider it to be an uncommitted DDL change, which pg_dump wouldn't beexpected to dump anyway.Back-patch to all active versions, and teach them to ignore invalidindexes in servers back to 8.2, where the concept was introduced.Michael Paquier
1 parent625b237 commit683abc7

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

‎src/bin/pg_dump/pg_dump.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4920,6 +4920,7 @@ getIndexes(Archive *fout, TableInfo tblinfo[], int numTables)
49204920
"i.indexrelid = c.conindid AND "
49214921
"c.contype IN ('p','u','x')) "
49224922
"WHERE i.indrelid = '%u'::pg_catalog.oid "
4923+
"AND i.indisvalid "
49234924
"ORDER BY indexname",
49244925
tbinfo->dobj.catId.oid);
49254926
}
@@ -4949,6 +4950,7 @@ getIndexes(Archive *fout, TableInfo tblinfo[], int numTables)
49494950
"ON (d.refclassid = c.tableoid "
49504951
"AND d.refobjid = c.oid) "
49514952
"WHERE i.indrelid = '%u'::pg_catalog.oid "
4953+
"AND i.indisvalid "
49524954
"ORDER BY indexname",
49534955
tbinfo->dobj.catId.oid);
49544956
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp