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

Commit c7e21e9

Browse files
committed
Tighten pg_upgrade's new check for non-upgradable anyarray usages.
We only need to reject cases when the aggregate or operator is itself declared with a polymorphic type. Per buildfarm. Discussion: https://postgr.es/m/3383880.QJadu78ljV@vejsadalnx
1 parent 4a37527 commit c7e21e9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/bin/pg_upgrade/check.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1070,6 +1070,7 @@ check_for_incompatible_polymorphics(ClusterInfo *cluster)
10701070
"JOIN pg_proc AS transfn ON transfn.oid=a.aggtransfn "
10711071
"WHERE p.oid >= 16384 "
10721072
"AND a.aggtransfn = ANY(ARRAY[%s]::regprocedure[]) "
1073+
"AND a.aggtranstype = ANY(ARRAY['anyarray', 'anyelement']::regtype[]) "
10731074

10741075
/* Aggregate final functions */
10751076
"UNION ALL "
@@ -1079,13 +1080,15 @@ check_for_incompatible_polymorphics(ClusterInfo *cluster)
10791080
"JOIN pg_proc AS finalfn ON finalfn.oid=a.aggfinalfn "
10801081
"WHERE p.oid >= 16384 "
10811082
"AND a.aggfinalfn = ANY(ARRAY[%s]::regprocedure[]) "
1083+
"AND a.aggtranstype = ANY(ARRAY['anyarray', 'anyelement']::regtype[]) "
10821084

10831085
/* Operators */
10841086
"UNION ALL "
10851087
"SELECT 'operator' AS objkind, op.oid::regoperator::text AS objname "
10861088
"FROM pg_operator AS op "
10871089
"WHERE op.oid >= 16384 "
1088-
"AND oprcode = ANY(ARRAY[%s]::regprocedure[]);",
1090+
"AND oprcode = ANY(ARRAY[%s]::regprocedure[]) "
1091+
"AND oprleft = ANY(ARRAY['anyarray', 'anyelement']::regtype[]);",
10891092
old_polymorphics.data,
10901093
old_polymorphics.data,
10911094
old_polymorphics.data);

0 commit comments

Comments
 (0)