pg_upgrade: avoid ALTER COLUMN TYPE on inherited columns

This only affects upgrades from 8.3 currently, and is harmless as the
child just generates an error in the script, but we should get it right
in case we ever need this for more complex uses.

Per report from Peter Eisentraut
This commit is contained in:
Bruce Momjian 2013-11-19 15:00:49 -05:00
parent b1543cc8a8
commit dbd786bc4f
1 changed files with 4 additions and 0 deletions

View File

@ -325,6 +325,8 @@ old_8_3_rebuild_tsvector_tables(ClusterInfo *cluster, bool check_mode)
"WHERE c.relkind = 'r' AND "
" c.oid = a.attrelid AND "
" NOT a.attisdropped AND "
/* child attribute changes are processed by the parent */
" a.attinhcount = 0 AND "
" a.atttypid = 'pg_catalog.tsvector'::pg_catalog.regtype AND "
" c.relnamespace = n.oid AND "
/* exclude possible orphaned temp tables */
@ -346,6 +348,8 @@ old_8_3_rebuild_tsvector_tables(ClusterInfo *cluster, bool check_mode)
"WHERE c.relkind = 'r' AND " \
" c.oid = a.attrelid AND " \
" NOT a.attisdropped AND " \
/* child attribute changes are processed by the parent */ \
" a.attinhcount = 0 AND " \
" a.atttypid = 'pg_catalog.tsvector'::pg_catalog.regtype AND " \
" c.relnamespace = n.oid AND " \
" n.nspname !~ '^pg_' AND " \