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 $ */
2
2
3
3
-- Adjust this setting to control where the objects get created.
4
4
SET search_path = public;
5
5
6
6
-- Internal function for the aggregate
7
7
-- Is called for each item in an aggregation
8
- CREATE OR REPLACE FUNCTION int_agg_state (int4[] , int4)
9
- RETURNS int4[]
10
- AS 'MODULE_PATHNAME','int_agg_state '
11
- LANGUAGE C ;
8
+ CREATE OR REPLACE FUNCTION int_agg_state (internal , int4)
9
+ RETURNS internal
10
+ AS ' array_agg_transfn '
11
+ LANGUAGE INTERNAL ;
12
12
13
13
-- Internal function for the aggregate
14
14
-- 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 REPLACE FUNCTION int_agg_final_array (internal )
16
16
RETURNS int4[]
17
- AS 'MODULE_PATHNAME','int_agg_final_array '
18
- LANGUAGE C ;
17
+ AS ' array_agg_finalfn '
18
+ LANGUAGE INTERNAL ;
19
19
20
20
-- The aggregate function itself
21
21
-- uses the above functions to create an array of integers from an aggregation.
22
22
CREATE AGGREGATE int_array_aggregate (
23
23
BASETYPE = int4,
24
24
SFUNC = int_agg_state,
25
- STYPE = int4[] ,
25
+ STYPE = internal ,
26
26
FINALFUNC = int_agg_final_array
27
27
);
28
28
@@ -31,5 +31,5 @@ CREATE AGGREGATE int_array_aggregate (
31
31
-- as a row.
32
32
CREATE OR REPLACE FUNCTION int_array_enum (int4[])
33
33
RETURNS setof integer
34
- AS 'MODULE_PATHNAME','int_enum '
35
- LANGUAGE C IMMUTABLE STRICT;
34
+ AS ' array_unnest '
35
+ LANGUAGE INTERNAL IMMUTABLE STRICT;
0 commit comments