# contrib/intagg/Makefile
EXTENSION = intagg
-DATA = intagg--1.0.sql intagg--unpackaged--1.0.sql
+DATA = intagg--1.1.sql intagg--1.0--1.1.sql intagg--unpackaged--1.0.sql
ifdef USE_PGXS
PG_CONFIG = pg_config
--- /dev/null
+/* contrib/intagg/intagg--1.0--1.1.sql */
+
+-- complain if script is sourced in psql, rather than via ALTER EXTENSION
+\echo Use "ALTER EXTENSION intagg UPDATE TO '1.1'" to load this file. \quit
+
+ALTER FUNCTION int_agg_state(internal, int4) PARALLEL SAFE;
+ALTER FUNCTION int_agg_final_array(internal) PARALLEL SAFE;
+ALTER FUNCTION int_array_enum(int4[]) PARALLEL SAFE;
+
+UPDATE pg_proc SET proparallel = 's'
+WHERE oid = 'int_array_aggregate(int4)'::regprocedure;
-/* contrib/intagg/intagg--1.0.sql */
+/* contrib/intagg/intagg--1.1.sql */
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
\echo Use "CREATE EXTENSION intagg" to load this file. \quit
CREATE FUNCTION int_agg_state (internal, int4)
RETURNS internal
AS 'array_agg_transfn'
+PARALLEL SAFE
LANGUAGE INTERNAL;
-- Internal function for the aggregate
CREATE FUNCTION int_agg_final_array (internal)
RETURNS int4[]
AS 'array_agg_finalfn'
+PARALLEL SAFE
LANGUAGE INTERNAL;
-- The aggregate function itself
-- uses the above functions to create an array of integers from an aggregation.
-CREATE AGGREGATE int_array_aggregate (
- BASETYPE = int4,
+CREATE AGGREGATE int_array_aggregate(int4) (
SFUNC = int_agg_state,
STYPE = internal,
- FINALFUNC = int_agg_final_array
+ FINALFUNC = int_agg_final_array,
+ PARALLEL = SAFE
);
-- The enumeration function
CREATE FUNCTION int_array_enum(int4[])
RETURNS setof integer
AS 'array_unnest'
-LANGUAGE INTERNAL IMMUTABLE STRICT;
+LANGUAGE INTERNAL IMMUTABLE STRICT PARALLEL SAFE;