Commit 1ab194a3 authored by Robert Haas's avatar Robert Haas

Update intagg extension for parallel query.

All functions provided by this extension are PARALLEL SAFE.

Andreas Karlsson
parent ffab82fb
# 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
......
/* 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
......@@ -8,6 +8,7 @@
CREATE FUNCTION int_agg_state (internal, int4)
RETURNS internal
AS 'array_agg_transfn'
PARALLEL SAFE
LANGUAGE INTERNAL;
-- Internal function for the aggregate
......@@ -15,15 +16,16 @@ LANGUAGE INTERNAL;
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
......@@ -32,4 +34,4 @@ CREATE AGGREGATE int_array_aggregate (
CREATE FUNCTION int_array_enum(int4[])
RETURNS setof integer
AS 'array_unnest'
LANGUAGE INTERNAL IMMUTABLE STRICT;
LANGUAGE INTERNAL IMMUTABLE STRICT PARALLEL SAFE;
# intagg extension
comment = 'integer aggregator and enumerator (obsolete)'
default_version = '1.0'
default_version = '1.1'
relocatable = true
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment