aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2013-11-19 15:00:49 -0500
committerBruce Momjian <bruce@momjian.us>2013-11-19 15:00:49 -0500
commitdbd786bc4f497210551a7640ee2f6afe877cc3e9 (patch)
tree122cd1d33c8d6cf1ed1da4b6df014d3a3efad30b
parentb1543cc8a84bc3ca699497286608274c2533fd53 (diff)
downloadpostgresql-dbd786bc4f497210551a7640ee2f6afe877cc3e9.tar.gz
postgresql-dbd786bc4f497210551a7640ee2f6afe877cc3e9.zip
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
-rw-r--r--contrib/pg_upgrade/version_old_8_3.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/contrib/pg_upgrade/version_old_8_3.c b/contrib/pg_upgrade/version_old_8_3.c
index 84a47eec596..e8438b6cb0b 100644
--- a/contrib/pg_upgrade/version_old_8_3.c
+++ b/contrib/pg_upgrade/version_old_8_3.c
@@ -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 " \