Skip to content

Commit 421d486

Browse files
tglsfdcreshke
authored andcommitted
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 4d00564 commit 421d486

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/bin/pg_upgrade/check.c

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

12521253
/* Aggregate final functions */
12531254
"UNION ALL "
@@ -1257,13 +1258,15 @@ check_for_incompatible_polymorphics(ClusterInfo *cluster)
12571258
"JOIN pg_proc AS finalfn ON finalfn.oid=a.aggfinalfn "
12581259
"WHERE p.oid >= 16384 "
12591260
"AND a.aggfinalfn = ANY(ARRAY[%s]::regprocedure[]) "
1261+
"AND a.aggtranstype = ANY(ARRAY['anyarray', 'anyelement']::regtype[]) "
12601262

12611263
/* Operators */
12621264
"UNION ALL "
12631265
"SELECT 'operator' AS objkind, op.oid::regoperator::text AS objname "
12641266
"FROM pg_operator AS op "
12651267
"WHERE op.oid >= 16384 "
1266-
"AND oprcode = ANY(ARRAY[%s]::regprocedure[]);",
1268+
"AND oprcode = ANY(ARRAY[%s]::regprocedure[]) "
1269+
"AND oprleft = ANY(ARRAY['anyarray', 'anyelement']::regtype[]);",
12671270
old_polymorphics.data,
12681271
old_polymorphics.data,
12691272
old_polymorphics.data);

0 commit comments

Comments
 (0)