Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit dbd786b

Browse files
committed
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
1 parent b1543cc commit dbd786b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

contrib/pg_upgrade/version_old_8_3.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,8 @@ old_8_3_rebuild_tsvector_tables(ClusterInfo *cluster, bool check_mode)
325325
"WHERE c.relkind = 'r' AND "
326326
" c.oid = a.attrelid AND "
327327
" NOT a.attisdropped AND "
328+
/* child attribute changes are processed by the parent */
329+
" a.attinhcount = 0 AND "
328330
" a.atttypid = 'pg_catalog.tsvector'::pg_catalog.regtype AND "
329331
" c.relnamespace = n.oid AND "
330332
/* exclude possible orphaned temp tables */
@@ -346,6 +348,8 @@ old_8_3_rebuild_tsvector_tables(ClusterInfo *cluster, bool check_mode)
346348
"WHERE c.relkind = 'r' AND " \
347349
" c.oid = a.attrelid AND " \
348350
" NOT a.attisdropped AND " \
351+
/* child attribute changes are processed by the parent */ \
352+
" a.attinhcount = 0 AND " \
349353
" a.atttypid = 'pg_catalog.tsvector'::pg_catalog.regtype AND " \
350354
" c.relnamespace = n.oid AND " \
351355
" n.nspname !~ '^pg_' AND " \

0 commit comments

Comments
 (0)