Skip to content

Commit

Permalink
Must check indisready not just indisvalid when dumping from 9.2 server.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
tglsfdc committed Mar 29, 2013
1 parent 29505a8 commit aa02864
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/bin/pg_dump/pg_dump.c
Original file line number Diff line number Diff line change
Expand Up @@ -4901,6 +4901,10 @@ getIndexes(Archive *fout, TableInfo tblinfo[], int numTables)
resetPQExpBuffer(query);
if (fout->remoteVersion >= 90000)
{
/*
* the test on indisready is necessary in 9.2, and harmless in
* earlier/later versions
*/
appendPQExpBuffer(query,
"SELECT t.tableoid, t.oid, "
"t.relname AS indexname, "
Expand All @@ -4922,7 +4926,7 @@ getIndexes(Archive *fout, TableInfo tblinfo[], int numTables)
"i.indexrelid = c.conindid AND "
"c.contype IN ('p','u','x')) "
"WHERE i.indrelid = '%u'::pg_catalog.oid "
"AND i.indisvalid "
"AND i.indisvalid AND i.indisready "
"ORDER BY indexname",
tbinfo->dobj.catId.oid);
}
Expand Down

0 comments on commit aa02864

Please sign in to comment.