1996-08-28 03:59:28 +02:00
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
*
|
1999-02-14 00:22:53 +01:00
|
|
|
* pg_aggregate.h
|
1997-09-07 07:04:48 +02:00
|
|
|
* definition of the system "aggregate" relation (pg_aggregate)
|
|
|
|
* along with the relation's initial contents.
|
1996-08-28 03:59:28 +02:00
|
|
|
*
|
|
|
|
*
|
2003-08-04 04:40:20 +02:00
|
|
|
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
|
2000-01-26 06:58:53 +01:00
|
|
|
* Portions Copyright (c) 1994, Regents of the University of California
|
1996-08-28 03:59:28 +02:00
|
|
|
*
|
2003-11-29 23:41:33 +01:00
|
|
|
* $PostgreSQL: pgsql/src/include/catalog/pg_aggregate.h,v 1.42 2003/11/29 22:40:58 pgsql Exp $
|
1996-08-28 03:59:28 +02:00
|
|
|
*
|
|
|
|
* NOTES
|
1997-09-07 07:04:48 +02:00
|
|
|
* the genbki.sh script reads this file and generates .bki
|
|
|
|
* information from the DATA() statements.
|
1996-08-28 03:59:28 +02:00
|
|
|
*
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
#ifndef PG_AGGREGATE_H
|
|
|
|
#define PG_AGGREGATE_H
|
|
|
|
|
|
|
|
/* ----------------
|
1997-09-07 07:04:48 +02:00
|
|
|
* postgres.h contains the system type definitions and the
|
|
|
|
* CATALOG(), BOOTSTRAP and DATA() sugar words so this file
|
|
|
|
* can be read by both genbki.sh and the C compiler.
|
1996-08-28 03:59:28 +02:00
|
|
|
* ----------------
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* ----------------------------------------------------------------
|
1997-09-07 07:04:48 +02:00
|
|
|
* pg_aggregate definition.
|
1996-08-28 03:59:28 +02:00
|
|
|
*
|
1997-09-07 07:04:48 +02:00
|
|
|
* cpp turns this into typedef struct FormData_pg_aggregate
|
1996-08-28 03:59:28 +02:00
|
|
|
*
|
2002-04-11 22:00:18 +02:00
|
|
|
* aggfnoid pg_proc OID of the aggregate itself
|
2000-07-17 05:05:41 +02:00
|
|
|
* aggtransfn transition function
|
1997-09-07 07:04:48 +02:00
|
|
|
* aggfinalfn final function
|
2000-07-17 05:05:41 +02:00
|
|
|
* aggtranstype type of aggregate's transition (state) data
|
|
|
|
* agginitval initial value for transition state
|
1996-08-28 03:59:28 +02:00
|
|
|
* ----------------------------------------------------------------
|
1997-09-07 07:04:48 +02:00
|
|
|
*/
|
2002-04-11 22:00:18 +02:00
|
|
|
CATALOG(pg_aggregate) BKI_WITHOUT_OIDS
|
1997-09-07 07:04:48 +02:00
|
|
|
{
|
2002-04-11 22:00:18 +02:00
|
|
|
regproc aggfnoid;
|
2000-07-17 05:05:41 +02:00
|
|
|
regproc aggtransfn;
|
1997-09-08 04:41:22 +02:00
|
|
|
regproc aggfinalfn;
|
2000-07-17 05:05:41 +02:00
|
|
|
Oid aggtranstype;
|
|
|
|
text agginitval; /* VARIABLE LENGTH FIELD */
|
1996-08-28 03:59:28 +02:00
|
|
|
} FormData_pg_aggregate;
|
|
|
|
|
|
|
|
/* ----------------
|
1997-09-07 07:04:48 +02:00
|
|
|
* Form_pg_aggregate corresponds to a pointer to a tuple with
|
|
|
|
* the format of pg_aggregate relation.
|
1996-08-28 03:59:28 +02:00
|
|
|
* ----------------
|
|
|
|
*/
|
1997-09-07 07:04:48 +02:00
|
|
|
typedef FormData_pg_aggregate *Form_pg_aggregate;
|
1996-08-28 03:59:28 +02:00
|
|
|
|
|
|
|
/* ----------------
|
1997-09-07 07:04:48 +02:00
|
|
|
* compiler constants for pg_aggregate
|
1996-08-28 03:59:28 +02:00
|
|
|
* ----------------
|
|
|
|
*/
|
|
|
|
|
2002-04-11 22:00:18 +02:00
|
|
|
#define Natts_pg_aggregate 5
|
|
|
|
#define Anum_pg_aggregate_aggfnoid 1
|
|
|
|
#define Anum_pg_aggregate_aggtransfn 2
|
|
|
|
#define Anum_pg_aggregate_aggfinalfn 3
|
|
|
|
#define Anum_pg_aggregate_aggtranstype 4
|
|
|
|
#define Anum_pg_aggregate_agginitval 5
|
1996-08-28 03:59:28 +02:00
|
|
|
|
|
|
|
|
|
|
|
/* ----------------
|
|
|
|
* initial contents of pg_aggregate
|
|
|
|
* ---------------
|
|
|
|
*/
|
|
|
|
|
2002-04-11 22:00:18 +02:00
|
|
|
/* avg */
|
|
|
|
DATA(insert ( 2100 int8_accum numeric_avg 1231 "{0,0,0}" ));
|
|
|
|
DATA(insert ( 2101 int4_avg_accum int8_avg 1016 "{0,0}" ));
|
|
|
|
DATA(insert ( 2102 int2_avg_accum int8_avg 1016 "{0,0}" ));
|
|
|
|
DATA(insert ( 2103 numeric_accum numeric_avg 1231 "{0,0,0}" ));
|
|
|
|
DATA(insert ( 2104 float4_accum float8_avg 1022 "{0,0,0}" ));
|
|
|
|
DATA(insert ( 2105 float8_accum float8_avg 1022 "{0,0,0}" ));
|
|
|
|
DATA(insert ( 2106 interval_accum interval_avg 1187 "{0 second,0 second}" ));
|
|
|
|
|
|
|
|
/* sum */
|
|
|
|
DATA(insert ( 2107 int8_sum - 1700 _null_ ));
|
|
|
|
DATA(insert ( 2108 int4_sum - 20 _null_ ));
|
|
|
|
DATA(insert ( 2109 int2_sum - 20 _null_ ));
|
|
|
|
DATA(insert ( 2110 float4pl - 700 _null_ ));
|
|
|
|
DATA(insert ( 2111 float8pl - 701 _null_ ));
|
|
|
|
DATA(insert ( 2112 cash_pl - 790 _null_ ));
|
|
|
|
DATA(insert ( 2113 interval_pl - 1186 _null_ ));
|
|
|
|
DATA(insert ( 2114 numeric_add - 1700 _null_ ));
|
|
|
|
|
|
|
|
/* max */
|
|
|
|
DATA(insert ( 2115 int8larger - 20 _null_ ));
|
|
|
|
DATA(insert ( 2116 int4larger - 23 _null_ ));
|
|
|
|
DATA(insert ( 2117 int2larger - 21 _null_ ));
|
|
|
|
DATA(insert ( 2118 oidlarger - 26 _null_ ));
|
|
|
|
DATA(insert ( 2119 float4larger - 700 _null_ ));
|
|
|
|
DATA(insert ( 2120 float8larger - 701 _null_ ));
|
|
|
|
DATA(insert ( 2121 int4larger - 702 _null_ ));
|
|
|
|
DATA(insert ( 2122 date_larger - 1082 _null_ ));
|
|
|
|
DATA(insert ( 2123 time_larger - 1083 _null_ ));
|
|
|
|
DATA(insert ( 2124 timetz_larger - 1266 _null_ ));
|
|
|
|
DATA(insert ( 2125 cashlarger - 790 _null_ ));
|
|
|
|
DATA(insert ( 2126 timestamp_larger - 1114 _null_ ));
|
|
|
|
DATA(insert ( 2127 timestamptz_larger - 1184 _null_ ));
|
2002-09-04 22:31:48 +02:00
|
|
|
DATA(insert ( 2128 interval_larger - 1186 _null_ ));
|
2002-04-11 22:00:18 +02:00
|
|
|
DATA(insert ( 2129 text_larger - 25 _null_ ));
|
|
|
|
DATA(insert ( 2130 numeric_larger - 1700 _null_ ));
|
|
|
|
|
|
|
|
/* min */
|
|
|
|
DATA(insert ( 2131 int8smaller - 20 _null_ ));
|
|
|
|
DATA(insert ( 2132 int4smaller - 23 _null_ ));
|
|
|
|
DATA(insert ( 2133 int2smaller - 21 _null_ ));
|
|
|
|
DATA(insert ( 2134 oidsmaller - 26 _null_ ));
|
|
|
|
DATA(insert ( 2135 float4smaller - 700 _null_ ));
|
|
|
|
DATA(insert ( 2136 float8smaller - 701 _null_ ));
|
|
|
|
DATA(insert ( 2137 int4smaller - 702 _null_ ));
|
|
|
|
DATA(insert ( 2138 date_smaller - 1082 _null_ ));
|
|
|
|
DATA(insert ( 2139 time_smaller - 1083 _null_ ));
|
|
|
|
DATA(insert ( 2140 timetz_smaller - 1266 _null_ ));
|
|
|
|
DATA(insert ( 2141 cashsmaller - 790 _null_ ));
|
|
|
|
DATA(insert ( 2142 timestamp_smaller - 1114 _null_ ));
|
2002-09-04 22:31:48 +02:00
|
|
|
DATA(insert ( 2143 timestamptz_smaller - 1184 _null_ ));
|
2002-04-11 22:00:18 +02:00
|
|
|
DATA(insert ( 2144 interval_smaller - 1186 _null_ ));
|
|
|
|
DATA(insert ( 2145 text_smaller - 25 _null_ ));
|
2002-09-04 22:31:48 +02:00
|
|
|
DATA(insert ( 2146 numeric_smaller - 1700 _null_ ));
|
2000-07-17 05:05:41 +02:00
|
|
|
|
|
|
|
/*
|
2001-08-15 00:21:59 +02:00
|
|
|
* Using int8inc for count() is cheating a little, since it really only
|
2000-07-17 05:05:41 +02:00
|
|
|
* takes 1 parameter not 2, but nodeAgg.c won't complain ...
|
|
|
|
*/
|
2002-04-11 22:00:18 +02:00
|
|
|
DATA(insert ( 2147 int8inc - 20 0 ));
|
|
|
|
|
|
|
|
/* variance */
|
|
|
|
DATA(insert ( 2148 int8_accum numeric_variance 1231 "{0,0,0}" ));
|
|
|
|
DATA(insert ( 2149 int4_accum numeric_variance 1231 "{0,0,0}" ));
|
|
|
|
DATA(insert ( 2150 int2_accum numeric_variance 1231 "{0,0,0}" ));
|
2002-09-04 22:31:48 +02:00
|
|
|
DATA(insert ( 2151 float4_accum float8_variance 1022 "{0,0,0}" ));
|
|
|
|
DATA(insert ( 2152 float8_accum float8_variance 1022 "{0,0,0}" ));
|
2002-04-11 22:00:18 +02:00
|
|
|
DATA(insert ( 2153 numeric_accum numeric_variance 1231 "{0,0,0}" ));
|
|
|
|
|
|
|
|
/* stddev */
|
|
|
|
DATA(insert ( 2154 int8_accum numeric_stddev 1231 "{0,0,0}" ));
|
|
|
|
DATA(insert ( 2155 int4_accum numeric_stddev 1231 "{0,0,0}" ));
|
|
|
|
DATA(insert ( 2156 int2_accum numeric_stddev 1231 "{0,0,0}" ));
|
|
|
|
DATA(insert ( 2157 float4_accum float8_stddev 1022 "{0,0,0}" ));
|
|
|
|
DATA(insert ( 2158 float8_accum float8_stddev 1022 "{0,0,0}" ));
|
|
|
|
DATA(insert ( 2159 numeric_accum numeric_stddev 1231 "{0,0,0}" ));
|
1996-08-28 03:59:28 +02:00
|
|
|
|
|
|
|
/*
|
1997-04-03 21:56:47 +02:00
|
|
|
* prototypes for functions in pg_aggregate.c
|
1996-08-28 03:59:28 +02:00
|
|
|
*/
|
2002-03-29 20:06:29 +01:00
|
|
|
extern void AggregateCreate(const char *aggName,
|
2002-09-04 22:31:48 +02:00
|
|
|
Oid aggNamespace,
|
|
|
|
List *aggtransfnName,
|
|
|
|
List *aggfinalfnName,
|
|
|
|
Oid aggBaseType,
|
|
|
|
Oid aggTransType,
|
|
|
|
const char *agginitval);
|
2000-05-30 06:25:00 +02:00
|
|
|
|
2001-11-05 18:46:40 +01:00
|
|
|
#endif /* PG_AGGREGATE_H */
|