summaryrefslogtreecommitdiff
path: root/contrib/pg_upgrade/info.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/pg_upgrade/info.c')
-rw-r--r--contrib/pg_upgrade/info.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/contrib/pg_upgrade/info.c b/contrib/pg_upgrade/info.c
index c406941c981..6cc10c7b5a0 100644
--- a/contrib/pg_upgrade/info.c
+++ b/contrib/pg_upgrade/info.c
@@ -274,7 +274,13 @@ get_rel_infos(ClusterInfo *cluster, DbInfo *dbinfo)
"CREATE TEMPORARY TABLE info_rels (reloid) AS SELECT c.oid "
"FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n "
" ON c.relnamespace = n.oid "
+ "LEFT OUTER JOIN pg_catalog.pg_index i "
+ " ON c.oid = i.indexrelid "
"WHERE relkind IN ('r', 'i'%s) AND "
+ /* pg_dump only dumps valid indexes; testing indisready is
+ * necessary in 9.2, and harmless in earlier/later versions. */
+ " i.indisvalid IS DISTINCT FROM false AND "
+ " i.indisready IS DISTINCT FROM false AND "
/* exclude possible orphaned temp tables */
" ((n.nspname !~ '^pg_temp_' AND "
" n.nspname !~ '^pg_toast_temp_' AND "