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

Commit32cc9e5

Browse files
committed
Reduce contrib/intagg to a thin wrapper around the new core functions
array_agg() and unnest(). We could drop it entirely in the future,but let's keep it for a release or two as a compatibility assist.
1 parent9e0247a commit32cc9e5

File tree

5 files changed

+25
-321
lines changed

5 files changed

+25
-321
lines changed

‎contrib/intagg/Makefile

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,9 @@
22
# Makefile for integer aggregator
33
# Copyright (C) 2001 Digital Music Network.
44
# by Mark L. Woodward
5-
# $PostgreSQL: pgsql/contrib/intagg/Makefile,v 1.9 2007/11/10 23:59:51 momjian Exp $
5+
# $PostgreSQL: pgsql/contrib/intagg/Makefile,v 1.10 2008/11/14 19:58:45 tgl Exp $
66

7-
MODULES = int_aggregate
8-
DATA_built = int_aggregate.sql
9-
DATA = uninstall_int_aggregate.sql
7+
DATA = int_aggregate.sql uninstall_int_aggregate.sql
108

119
ifdefUSE_PGXS
1210
PG_CONFIG = pg_config

‎contrib/intagg/int_aggregate.c

Lines changed: 0 additions & 278 deletions
This file was deleted.
Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
1-
/* $PostgreSQL: pgsql/contrib/intagg/int_aggregate.sql.in,v 1.9 2007/11/13 04:24:28 momjian Exp $ */
1+
/* $PostgreSQL: pgsql/contrib/intagg/int_aggregate.sql,v 1.1 2008/11/14 19:58:45 tgl Exp $*/
22

33
-- Adjust this setting to control where the objects get created.
44
SET search_path= public;
55

66
-- Internal function for the aggregate
77
-- Is called for each item in an aggregation
8-
CREATE OR REPLACE FUNCTION int_agg_state (int4[], int4)
9-
RETURNSint4[]
10-
AS 'MODULE_PATHNAME','int_agg_state'
11-
LANGUAGEC;
8+
CREATE OR REPLACEFUNCTIONint_agg_state (internal, int4)
9+
RETURNSinternal
10+
AS'array_agg_transfn'
11+
LANGUAGEINTERNAL;
1212

1313
-- Internal function for the aggregate
1414
-- Is called at the end of the aggregation, and returns an array.
15-
CREATE OR REPLACE FUNCTION int_agg_final_array (int4[])
15+
CREATE OR REPLACEFUNCTIONint_agg_final_array (internal)
1616
RETURNS int4[]
17-
AS 'MODULE_PATHNAME','int_agg_final_array'
18-
LANGUAGEC;
17+
AS'array_agg_finalfn'
18+
LANGUAGEINTERNAL;
1919

2020
-- The aggregate function itself
2121
-- uses the above functions to create an array of integers from an aggregation.
2222
CREATEAGGREGATEint_array_aggregate (
2323
BASETYPE= int4,
2424
SFUNC= int_agg_state,
25-
STYPE =int4[],
25+
STYPE=internal,
2626
FINALFUNC= int_agg_final_array
2727
);
2828

@@ -31,5 +31,5 @@ CREATE AGGREGATE int_array_aggregate (
3131
-- as a row.
3232
CREATE OR REPLACEFUNCTIONint_array_enum(int4[])
3333
RETURNS setofinteger
34-
AS 'MODULE_PATHNAME','int_enum'
35-
LANGUAGEC IMMUTABLE STRICT;
34+
AS'array_unnest'
35+
LANGUAGEINTERNAL IMMUTABLE STRICT;
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $PostgreSQL: pgsql/contrib/intagg/uninstall_int_aggregate.sql,v 1.3 2007/11/13 04:24:28 momjian Exp $*/
1+
/* $PostgreSQL: pgsql/contrib/intagg/uninstall_int_aggregate.sql,v 1.4 2008/11/14 19:58:45 tgl Exp $*/
22

33
-- Adjust this setting to control where the objects get dropped.
44
SET search_path= public;
@@ -7,6 +7,6 @@ DROP FUNCTION int_array_enum(int4[]);
77

88
DROPAGGREGATE int_array_aggregate (int4);
99

10-
DROPFUNCTION int_agg_final_array (int4[]);
10+
DROPFUNCTION int_agg_final_array (internal);
1111

12-
DROPFUNCTION int_agg_state (int4[], int4);
12+
DROPFUNCTION int_agg_state (internal, int4);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp