Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1ab194a

Browse files
committed
Update intagg extension for parallel query.
All functions provided by this extension are PARALLEL SAFE.Andreas Karlsson
1 parentffab82f commit1ab194a

File tree

4 files changed

+20
-7
lines changed

4 files changed

+20
-7
lines changed

‎contrib/intagg/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# contrib/intagg/Makefile
22

33
EXTENSION = intagg
4-
DATA = intagg--1.0.sql intagg--unpackaged--1.0.sql
4+
DATA = intagg--1.1.sql intagg--1.0--1.1.sql intagg--unpackaged--1.0.sql
55

66
ifdefUSE_PGXS
77
PG_CONFIG = pg_config

‎contrib/intagg/intagg--1.0--1.1.sql

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/* contrib/intagg/intagg--1.0--1.1.sql*/
2+
3+
-- complain if script is sourced in psql, rather than via ALTER EXTENSION
4+
\echo Use"ALTER EXTENSION intagg UPDATE TO '1.1'" to load this file. \quit
5+
6+
ALTERFUNCTION int_agg_state(internal, int4) PARALLEL SAFE;
7+
ALTERFUNCTION int_agg_final_array(internal) PARALLEL SAFE;
8+
ALTERFUNCTION int_array_enum(int4[]) PARALLEL SAFE;
9+
10+
UPDATE pg_procSET proparallel='s'
11+
WHEREoid='int_array_aggregate(int4)'::regprocedure;
Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* contrib/intagg/intagg--1.0.sql*/
1+
/* contrib/intagg/intagg--1.1.sql*/
22

33
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
44
\echo Use"CREATE EXTENSION intagg" to load this file. \quit
@@ -8,22 +8,24 @@
88
CREATEFUNCTIONint_agg_state (internal, int4)
99
RETURNS internal
1010
AS'array_agg_transfn'
11+
PARALLEL SAFE
1112
LANGUAGE INTERNAL;
1213

1314
-- Internal function for the aggregate
1415
-- Is called at the end of the aggregation, and returns an array.
1516
CREATEFUNCTIONint_agg_final_array (internal)
1617
RETURNS int4[]
1718
AS'array_agg_finalfn'
19+
PARALLEL SAFE
1820
LANGUAGE INTERNAL;
1921

2022
-- The aggregate function itself
2123
-- uses the above functions to create an array of integers from an aggregation.
22-
CREATEAGGREGATEint_array_aggregate (
23-
BASETYPE= int4,
24+
CREATEAGGREGATEint_array_aggregate(int4) (
2425
SFUNC= int_agg_state,
2526
STYPE= internal,
26-
FINALFUNC= int_agg_final_array
27+
FINALFUNC= int_agg_final_array,
28+
PARALLEL= SAFE
2729
);
2830

2931
-- The enumeration function
@@ -32,4 +34,4 @@ CREATE AGGREGATE int_array_aggregate (
3234
CREATEFUNCTIONint_array_enum(int4[])
3335
RETURNS setofinteger
3436
AS'array_unnest'
35-
LANGUAGE INTERNAL IMMUTABLE STRICT;
37+
LANGUAGE INTERNAL IMMUTABLE STRICT PARALLEL SAFE;

‎contrib/intagg/intagg.control

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# intagg extension
22
comment = 'integer aggregator and enumerator (obsolete)'
3-
default_version = '1.0'
3+
default_version = '1.1'
44
relocatable = true

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp