~vcs-imports/mammoth-replicator/trunk

« back to all changes in this revision

Viewing changes to src/test/regress/sql/create_aggregate.sql

  • Committer: alvherre
  • Date: 2005-12-16 21:24:52 UTC
  • Revision ID: svn-v4:db760fc0-0f08-0410-9d63-cc6633f64896:trunk:1
Initial import of the REL8_0_3 sources from the Pgsql CVS repository.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
--
 
2
-- CREATE_AGGREGATE
 
3
--
 
4
 
 
5
-- all functions CREATEd
 
6
CREATE AGGREGATE newavg (
 
7
   sfunc = int4_accum, basetype = int4, stype = _numeric, 
 
8
   finalfunc = numeric_avg,
 
9
   initcond1 = '{0,0,0}'
 
10
);
 
11
 
 
12
-- test comments
 
13
COMMENT ON AGGREGATE newavg_wrong (int4) IS 'an agg comment';
 
14
COMMENT ON AGGREGATE newavg (int4) IS 'an agg comment';
 
15
COMMENT ON AGGREGATE newavg (int4) IS NULL;
 
16
 
 
17
-- without finalfunc; test obsolete spellings 'sfunc1' etc
 
18
CREATE AGGREGATE newsum (
 
19
   sfunc1 = int4pl, basetype = int4, stype1 = int4, 
 
20
   initcond1 = '0'
 
21
);
 
22
 
 
23
-- value-independent transition function
 
24
CREATE AGGREGATE newcnt (
 
25
   sfunc = int4inc, basetype = 'any', stype = int4,
 
26
   initcond = '0'
 
27
);
 
28
 
 
29
COMMENT ON AGGREGATE nosuchagg (*) IS 'should fail';
 
30
COMMENT ON AGGREGATE newcnt (*) IS 'an any agg comment';
 
31
COMMENT ON AGGREGATE newcnt (*) IS NULL;