mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +03:00
pg_upgrade: don't copy/link files for invalid indexes
Now that pg_dump no longer dumps invalid indexes, per commit
683abc73df
, have pg_upgrade also skip
them. Previously pg_upgrade threw an error if invalid indexes existed.
Backpatch to 9.2, 9.1, and 9.0 (where pg_upgrade was added to git)
This commit is contained in:
@ -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 "
|
||||
|
Reference in New Issue
Block a user