Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1n7f2H-0007hh-8z for pgsql-general@arkaria.postgresql.org; Wed, 12 Jan 2022 14:55:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1n7f2F-0004il-K6 for pgsql-general@arkaria.postgresql.org; Wed, 12 Jan 2022 14:55:35 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1n7f2F-0004ic-9l for pgsql-general@lists.postgresql.org; Wed, 12 Jan 2022 14:55:35 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1n7f2C-0000Ki-Sx for pgsql-general@lists.postgresql.org; Wed, 12 Jan 2022 14:55:34 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 20CEtUf52995240; Wed, 12 Jan 2022 09:55:30 -0500 From: Tom Lane To: Jasvant Singh cc: pgsql-general@lists.postgresql.org Subject: Re: Unable to migrate from postgres-13 to 14 In-reply-to: References: Comments: In-reply-to Jasvant Singh message dated "Wed, 12 Jan 2022 19:29:04 +0530" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2995238.1641999330.1@sss.pgh.pa.us> Date: Wed, 12 Jan 2022 09:55:30 -0500 Message-ID: <2995239.1641999330@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Jasvant Singh 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