pg.ddx.io pgsql-general@postgresql.org mailing list archive
help / color / mirror / Atom feedUnable to migrate from postgres-13 to 14
2+ messages / 2 participants
[nested] [flat]
* Unable to migrate from postgres-13 to 14
@ 2022-01-12 13:59 Jasvant Singh <jasingh@watermarkinsights.com>
0 siblings, 1 reply; 2+ messages in thread
From: Jasvant Singh @ 2022-01-12 13:59 UTC (permalink / raw)
To: pgsql-general@lists.postgresql.org
Hi,
I am trying to migrate my database from postgres-13 to 14 but getting
following error:
pg_restore: error: could not execute query: ERROR: function
array_append(anyarray, anyelement) does not exist
Command was: CREATE AGGREGATE "public"."mode"("anyelement") (
SFUNC = "array_append",
STYPE = "anyarray",
INITCOND = '{}',
FINALFUNC = "public"."_final_mode"
);
To work around this problem I decided to drop this aggregate in postgres-13
and create it again with the supported version of array_append in
postgres-14.
But when I tried to drop it in postgres-13 I got following error:
#drop aggregate mode("anyelement") CASCADE;
ERROR: cannot drop function mode(anyelement) because it is required by the
database system
I don't understand why the database system is using my user defined
aggregate. If it is a system defined aggregate then it should not be copied
from postgres-13 to postgres-14. It should be there in postgres-14.
Please suggest some work around.
Thanks,
Jasvant
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: Unable to migrate from postgres-13 to 14
@ 2022-01-12 14:55 Tom Lane <tgl@sss.pgh.pa.us>
parent: Jasvant Singh <jasingh@watermarkinsights.com>
0 siblings, 0 replies; 2+ messages in thread
From: Tom Lane @ 2022-01-12 14:55 UTC (permalink / raw)
To: Jasvant Singh <jasingh@watermarkinsights.com>; +Cc: pgsql-general@lists.postgresql.org
Jasvant Singh <jasingh@watermarkinsights.com> writes:
> pg_restore: error: could not execute query: ERROR: function
> array_append(anyarray, anyelement) does not exist
> Command was: CREATE AGGREGATE "public"."mode"("anyelement") (
> SFUNC = "array_append",
> STYPE = "anyarray",
> INITCOND = '{}',
> FINALFUNC = "public"."_final_mode"
> );
> To work around this problem I decided to drop this aggregate in postgres-13
> and create it again with the supported version of array_append in
> postgres-14.
> But when I tried to drop it in postgres-13 I got following error:
> #drop aggregate mode("anyelement") CASCADE;
> ERROR: cannot drop function mode(anyelement) because it is required by the
> database system
I think this is trying to drop the built-in pg_catalog.mode(anyelement)
aggregate. Say DROP AGGREGATE public.mode("anyelement")
(I'd be pretty cautious about using CASCADE, too, at least till
you've seen what would get dropped.)
regards, tom lane
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2022-01-12 14:55 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2022-01-12 13:59 Unable to migrate from postgres-13 to 14 Jasvant Singh <jasingh@watermarkinsights.com>
2022-01-12 14:55 ` Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox