2000-01-05 18:31:08 +01:00
|
|
|
--
|
|
|
|
-- CREATE_AGGREGATE
|
|
|
|
--
|
|
|
|
-- all functions CREATEd
|
|
|
|
CREATE AGGREGATE newavg (
|
2000-07-17 05:05:41 +02:00
|
|
|
sfunc = int4_accum, basetype = int4, stype = _numeric,
|
|
|
|
finalfunc = numeric_avg,
|
|
|
|
initcond1 = '{0,0,0}'
|
1997-04-06 08:07:13 +02:00
|
|
|
);
|
2000-07-17 05:05:41 +02:00
|
|
|
-- without finalfunc; test obsolete spellings 'sfunc1' etc
|
2000-01-05 18:31:08 +01:00
|
|
|
CREATE AGGREGATE newsum (
|
|
|
|
sfunc1 = int4pl, basetype = int4, stype1 = int4,
|
1997-04-06 08:07:13 +02:00
|
|
|
initcond1 = '0'
|
|
|
|
);
|
2000-07-17 05:05:41 +02:00
|
|
|
-- value-independent transition function
|
2000-01-05 18:31:08 +01:00
|
|
|
CREATE AGGREGATE newcnt (
|
2000-07-17 05:05:41 +02:00
|
|
|
sfunc = int4inc, basetype = 'any', stype = int4,
|
|
|
|
initcond = '0'
|
1997-04-06 08:07:13 +02:00
|
|
|
);
|