From: Tom Lane Date: Fri, 29 Mar 2013 02:09:20 +0000 (-0400) Subject: Must check indisready not just indisvalid when dumping from 9.2 server. X-Git-Tag: REL9_2_4~10 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=723acc99bef562cf536d38d0a1967f24e9b4ede0;p=postgresql 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 683abc73dff549e94555d4020dae8d02f32ed78b, as noted by Andres Freund. --- diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c index 183408d1bc..f6ad798f58 100644 --- a/src/bin/pg_dump/pg_dump.c +++ b/src/bin/pg_dump/pg_dump.c @@ -4520,6 +4520,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, " @@ -4540,7 +4544,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); }