mirror of https://github.com/citusdata/citus.git
wip
parent
52769a4f4f
commit
63ee3277a5
|
@ -10,39 +10,6 @@ DECLARE
|
||||||
BEGIN
|
BEGIN
|
||||||
|
|
||||||
|
|
||||||
IF substring(current_Setting('server_version'), '\d+')::int >= 14 THEN
|
|
||||||
EXECUTE $cmd$
|
|
||||||
CREATE AGGREGATE array_cat_agg(anycompatiblearray) (SFUNC = array_cat, STYPE = anycompatiblearray);
|
|
||||||
COMMENT ON AGGREGATE array_cat_agg(anycompatiblearray)
|
|
||||||
IS 'concatenate input arrays into a single array';
|
|
||||||
$cmd$;
|
|
||||||
ELSE
|
|
||||||
EXECUTE $cmd$
|
|
||||||
CREATE AGGREGATE array_cat_agg(anyarray) (SFUNC = array_cat, STYPE = anyarray);
|
|
||||||
COMMENT ON AGGREGATE array_cat_agg(anyarray)
|
|
||||||
IS 'concatenate input arrays into a single array';
|
|
||||||
$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,
|
|
||||||
(SELECT oid FROM pg_proc WHERE proname = 'array_cat_agg') as objid,
|
|
||||||
0 as objsubid,
|
|
||||||
'pg_extension'::regclass::oid as refclassid,
|
|
||||||
(select oid from pg_extension where extname = 'citus') as refobjid,
|
|
||||||
0 as refobjsubid ,
|
|
||||||
'e' as deptype;
|
|
||||||
|
|
||||||
--
|
--
|
||||||
-- restore citus catalog tables
|
-- restore citus catalog tables
|
||||||
|
@ -106,6 +73,41 @@ BEGIN
|
||||||
EXECUTE command;
|
EXECUTE command;
|
||||||
END LOOP;
|
END LOOP;
|
||||||
|
|
||||||
|
|
||||||
|
IF substring(current_Setting('server_version'), '\d+')::int >= 14 THEN
|
||||||
|
EXECUTE $cmd$
|
||||||
|
CREATE AGGREGATE array_cat_agg(anycompatiblearray) (SFUNC = array_cat, STYPE = anycompatiblearray);
|
||||||
|
COMMENT ON AGGREGATE array_cat_agg(anycompatiblearray)
|
||||||
|
IS 'concatenate input arrays into a single array';
|
||||||
|
$cmd$;
|
||||||
|
ELSE
|
||||||
|
EXECUTE $cmd$
|
||||||
|
CREATE AGGREGATE array_cat_agg(anyarray) (SFUNC = array_cat, STYPE = anyarray);
|
||||||
|
COMMENT ON AGGREGATE array_cat_agg(anyarray)
|
||||||
|
IS 'concatenate input arrays into a single array';
|
||||||
|
$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,
|
||||||
|
(SELECT oid FROM pg_proc WHERE proname = 'array_cat_agg') as objid,
|
||||||
|
0 as objsubid,
|
||||||
|
'pg_extension'::regclass::oid as refclassid,
|
||||||
|
(select oid from pg_extension where extname = 'citus') as refobjid,
|
||||||
|
0 as refobjsubid ,
|
||||||
|
'e' as deptype;
|
||||||
|
|
||||||
--
|
--
|
||||||
-- set dependencies
|
-- set dependencies
|
||||||
--
|
--
|
||||||
|
|
|
@ -10,39 +10,6 @@ DECLARE
|
||||||
BEGIN
|
BEGIN
|
||||||
|
|
||||||
|
|
||||||
IF substring(current_Setting('server_version'), '\d+')::int >= 14 THEN
|
|
||||||
EXECUTE $cmd$
|
|
||||||
CREATE AGGREGATE array_cat_agg(anycompatiblearray) (SFUNC = array_cat, STYPE = anycompatiblearray);
|
|
||||||
COMMENT ON AGGREGATE array_cat_agg(anycompatiblearray)
|
|
||||||
IS 'concatenate input arrays into a single array';
|
|
||||||
$cmd$;
|
|
||||||
ELSE
|
|
||||||
EXECUTE $cmd$
|
|
||||||
CREATE AGGREGATE array_cat_agg(anyarray) (SFUNC = array_cat, STYPE = anyarray);
|
|
||||||
COMMENT ON AGGREGATE array_cat_agg(anyarray)
|
|
||||||
IS 'concatenate input arrays into a single array';
|
|
||||||
$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,
|
|
||||||
(SELECT oid FROM pg_proc WHERE proname = 'array_cat_agg') as objid,
|
|
||||||
0 as objsubid,
|
|
||||||
'pg_extension'::regclass::oid as refclassid,
|
|
||||||
(select oid from pg_extension where extname = 'citus') as refobjid,
|
|
||||||
0 as refobjsubid ,
|
|
||||||
'e' as deptype;
|
|
||||||
|
|
||||||
--
|
--
|
||||||
-- restore citus catalog tables
|
-- restore citus catalog tables
|
||||||
|
@ -106,6 +73,44 @@ BEGIN
|
||||||
EXECUTE command;
|
EXECUTE command;
|
||||||
END LOOP;
|
END LOOP;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
IF substring(current_Setting('server_version'), '\d+')::int >= 14 THEN
|
||||||
|
EXECUTE $cmd$
|
||||||
|
CREATE AGGREGATE array_cat_agg(anycompatiblearray) (SFUNC = array_cat, STYPE = anycompatiblearray);
|
||||||
|
COMMENT ON AGGREGATE array_cat_agg(anycompatiblearray)
|
||||||
|
IS 'concatenate input arrays into a single array';
|
||||||
|
$cmd$;
|
||||||
|
ELSE
|
||||||
|
EXECUTE $cmd$
|
||||||
|
CREATE AGGREGATE array_cat_agg(anyarray) (SFUNC = array_cat, STYPE = anyarray);
|
||||||
|
COMMENT ON AGGREGATE array_cat_agg(anyarray)
|
||||||
|
IS 'concatenate input arrays into a single array';
|
||||||
|
$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,
|
||||||
|
(SELECT oid FROM pg_proc WHERE proname = 'array_cat_agg') as objid,
|
||||||
|
0 as objsubid,
|
||||||
|
'pg_extension'::regclass::oid as refclassid,
|
||||||
|
(select oid from pg_extension where extname = 'citus') as refobjid,
|
||||||
|
0 as refobjsubid ,
|
||||||
|
'e' as deptype;
|
||||||
|
|
||||||
|
|
||||||
--
|
--
|
||||||
-- set dependencies
|
-- set dependencies
|
||||||
--
|
--
|
||||||
|
|
Loading…
Reference in New Issue