Skip to content

Commit aa02864

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 29505a8 commit aa02864

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
@@ -4901,6 +4901,10 @@ getIndexes(Archive *fout, TableInfo tblinfo[], int numTables)
49014901
resetPQExpBuffer(query);
49024902
if (fout->remoteVersion >= 90000)
49034903
{
4904+
/*
4905+
* the test on indisready is necessary in 9.2, and harmless in
4906+
* earlier/later versions
4907+
*/
49044908
appendPQExpBuffer(query,
49054909
"SELECT t.tableoid, t.oid, "
49064910
"t.relname AS indexname, "
@@ -4922,7 +4926,7 @@ getIndexes(Archive *fout, TableInfo tblinfo[], int numTables)
49224926
"i.indexrelid = c.conindid AND "
49234927
"c.contype IN ('p','u','x')) "
49244928
"WHERE i.indrelid = '%u'::pg_catalog.oid "
4925-
"AND i.indisvalid "
4929+
"AND i.indisvalid AND i.indisready "
49264930
"ORDER BY indexname",
49274931
tbinfo->dobj.catId.oid);
49284932
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy