8000 Must check indisready not just indisvalid when dumping from 9.2 server. · danielcode/postgres@723acc9 · GitHub
[go: up one dir, main page]

Skip to content

Commit 723acc9

Browse files
committed
Must check indisready not just indisvalid when dumping from 9.2 server.
9.2 uses a kluge representation of "indislive"; we have to account for that when examining pg_index. Simplest solution is to check indisready for 9.0 and 9.1 as well; that's harmless though unnecessary, so it's not worth making a version distinction for. Fixes oversight in commit 683abc7, as noted by Andres Freund.
1 parent eb2a70f commit 723acc9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/bin/pg_dump/pg_dump.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4520,6 +4520,10 @@ getIndexes(Archive *fout, TableInfo tblinfo[], int numTables)
45204520
resetPQExpBuffer(query);
45214521
if (fout->remoteVersion >= 90000)
45224522
{
4523+
/*
4524+
* the test on indisready is necessary in 9.2, and harmless in
4525+
* earlier/later versions
4526+
*/
45234527
appendPQExpBuffer(query,
45244528
"SELECT t.tableoid, t.oid, "
45254529
"t.relname AS indexname, "
@@ -4540,7 +4544,7 @@ getIndexes(Archive *fout, TableInfo tblinfo[], int numTables)
45404544
"i.indexrelid = c.conindid AND "
45414545
"c.contype IN ('p','u','x')) "
45424546
"WHERE i.indrelid = '%u'::pg_catalog.oid "
4543-
"AND i.indisvalid "
4547+
"AND i.indisvalid AND i.indisready "
45444548
"ORDER BY indexname",
45454549
tbinfo->dobj.catId.oid);
45464550
}

0 commit comments

Comments
 (0)
0