pg_upgrade (12->14) fails on aggregate

Petr Vejsada <pve@paymorrow.com>

From: Petr Vejsada <pve@paymorrow.com>
To: pgsql-bugs@lists.postgresql.org
Date: 2022-05-04T13:05:32Z
Lists: pgsql-bugs, pgsql-hackers
Hi Team,

we experienced pg_upgrade failing when attempted to upgrade from 12.10 to 14.2 
(on AWS RDS)

We had this aggregate:

CREATE AGGREGATE public.array_accum(anyelement) ( SFUNC = array_append, STYPE 
= anyarray, INITCOND = '{}');

Syntax in version 14 is changed (we didn't try to run version 13)

We solved it (in our case) dropping the aggregate before upgrade and re-create 
in using new syntax in V14:

CREATE AGGREGATE public.array_accum(anycompatible) ( SFUNC = array_append, 
STYPE = anycompatiblearray, INITCOND = '{}');

but pg_upgrade shouldn't fail on this.

I hope it can help to improve pg_upgrade process.

Thanks.

--
Best
Petr





Commits

  1. Tighten pg_upgrade's new check for non-upgradable anyarray usages.

  2. Fix pg_upgrade to detect non-upgradable anyarray usages.

  3. Remove pg_upgrade support for upgrading from pre-9.2 servers.