mirror of https://github.com/citusdata/citus.git
Pg now has its own any_value, don't create aggregate if exists
Relevant PG commit:
2ddab010c2
2ddab010c2777c6a965cea82dc1b809ddc33ecc1
naisila/user_arb_config
parent
a0ef4d4992
commit
324e1b47b0
|
@ -3,6 +3,7 @@ RETURNS anyelement AS $$
|
||||||
SELECT CASE WHEN $1 IS NULL THEN $2 ELSE $1 END;
|
SELECT CASE WHEN $1 IS NULL THEN $2 ELSE $1 END;
|
||||||
$$ LANGUAGE SQL STABLE;
|
$$ LANGUAGE SQL STABLE;
|
||||||
|
|
||||||
|
DO $$ BEGIN
|
||||||
CREATE AGGREGATE pg_catalog.any_value (
|
CREATE AGGREGATE pg_catalog.any_value (
|
||||||
sfunc = pg_catalog.any_value_agg,
|
sfunc = pg_catalog.any_value_agg,
|
||||||
combinefunc = pg_catalog.any_value_agg,
|
combinefunc = pg_catalog.any_value_agg,
|
||||||
|
@ -11,4 +12,6 @@ CREATE AGGREGATE pg_catalog.any_value (
|
||||||
);
|
);
|
||||||
COMMENT ON AGGREGATE pg_catalog.any_value(anyelement) IS
|
COMMENT ON AGGREGATE pg_catalog.any_value(anyelement) IS
|
||||||
'Returns the value of any row in the group. It is mostly useful when you know there will be only 1 element.';
|
'Returns the value of any row in the group. It is mostly useful when you know there will be only 1 element.';
|
||||||
|
EXCEPTION
|
||||||
|
WHEN duplicate_function THEN NULL;
|
||||||
|
END $$;
|
||||||
|
|
|
@ -3,6 +3,7 @@ RETURNS anyelement AS $$
|
||||||
SELECT CASE WHEN $1 IS NULL THEN $2 ELSE $1 END;
|
SELECT CASE WHEN $1 IS NULL THEN $2 ELSE $1 END;
|
||||||
$$ LANGUAGE SQL STABLE;
|
$$ LANGUAGE SQL STABLE;
|
||||||
|
|
||||||
|
DO $$ BEGIN
|
||||||
CREATE AGGREGATE pg_catalog.any_value (
|
CREATE AGGREGATE pg_catalog.any_value (
|
||||||
sfunc = pg_catalog.any_value_agg,
|
sfunc = pg_catalog.any_value_agg,
|
||||||
combinefunc = pg_catalog.any_value_agg,
|
combinefunc = pg_catalog.any_value_agg,
|
||||||
|
@ -11,4 +12,6 @@ CREATE AGGREGATE pg_catalog.any_value (
|
||||||
);
|
);
|
||||||
COMMENT ON AGGREGATE pg_catalog.any_value(anyelement) IS
|
COMMENT ON AGGREGATE pg_catalog.any_value(anyelement) IS
|
||||||
'Returns the value of any row in the group. It is mostly useful when you know there will be only 1 element.';
|
'Returns the value of any row in the group. It is mostly useful when you know there will be only 1 element.';
|
||||||
|
EXCEPTION
|
||||||
|
WHEN duplicate_function THEN NULL;
|
||||||
|
END $$;
|
||||||
|
|
Loading…
Reference in New Issue