Thread: pg_upgrade (12->14) fails on aggregate
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
On Wed, May 4, 2022 at 7:29 AM Petr Vejsada <pve@paymorrow.com> wrote:
We solved it (in our case) dropping the aggregate before upgrade and re-create
in using new syntax in V14:
but pg_upgrade shouldn't fail on this.
I hope it can help to improve pg_upgrade process.
The release notes say explicitly that one needs to drop and recreate the affected functions. Thus, we know about the issue and to date our best solution is to have the user do exactly what you did (i.e., it is not something pg_upgrade is going to do for you). If you have an alternative solution to suggest that would help.
https://www.postgresql.org/docs/current/release-14.html : the first compatibility note
David J.