From 4eaae0254971c5e130b90730a9fe24aa4423655f Mon Sep 17 00:00:00 2001 From: Sait Talha Nisanci Date: Fri, 27 Aug 2021 09:39:40 +0300 Subject: [PATCH] fixup! fix array_cat_agg for pg upgrades --- .../sql/udfs/citus_finish_pg_upgrade/10.2-1.sql | 10 ++++++++++ .../sql/udfs/citus_finish_pg_upgrade/latest.sql | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/src/backend/distributed/sql/udfs/citus_finish_pg_upgrade/10.2-1.sql b/src/backend/distributed/sql/udfs/citus_finish_pg_upgrade/10.2-1.sql index d679f98db..ae3b0b900 100644 --- a/src/backend/distributed/sql/udfs/citus_finish_pg_upgrade/10.2-1.sql +++ b/src/backend/distributed/sql/udfs/citus_finish_pg_upgrade/10.2-1.sql @@ -24,6 +24,16 @@ BEGIN $cmd$; END IF; + /* + * Citus creates the array_cat_agg but because of a compatibility + * issue between pg13-pg14, we drop and create it during upgrade. + * And as Citus creates it, there needs to be a dependency to the + * Citus extension, so we create that dependency here. + * We are not using: + * ALTER EXENSION citus DROP/CREATE AGGREGATE array_cat_agg + * because we don't have an easy way to check if the aggregate + * exists with anyarray type or anycompatiblearray type. + */ INSERT INTO pg_depend SELECT 'pg_proc'::regclass::oid as classid, diff --git a/src/backend/distributed/sql/udfs/citus_finish_pg_upgrade/latest.sql b/src/backend/distributed/sql/udfs/citus_finish_pg_upgrade/latest.sql index d679f98db..ae3b0b900 100644 --- a/src/backend/distributed/sql/udfs/citus_finish_pg_upgrade/latest.sql +++ b/src/backend/distributed/sql/udfs/citus_finish_pg_upgrade/latest.sql @@ -24,6 +24,16 @@ BEGIN $cmd$; END IF; + /* + * Citus creates the array_cat_agg but because of a compatibility + * issue between pg13-pg14, we drop and create it during upgrade. + * And as Citus creates it, there needs to be a dependency to the + * Citus extension, so we create that dependency here. + * We are not using: + * ALTER EXENSION citus DROP/CREATE AGGREGATE array_cat_agg + * because we don't have an easy way to check if the aggregate + * exists with anyarray type or anycompatiblearray type. + */ INSERT INTO pg_depend SELECT 'pg_proc'::regclass::oid as classid,