diff options
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/c.h | 21 | ||||
| -rw-r--r-- | src/include/catalog/catversion.h | 4 | ||||
| -rw-r--r-- | src/include/catalog/pg_aggregate.h | 166 | ||||
| -rw-r--r-- | src/include/catalog/pg_operator.h | 50 | ||||
| -rw-r--r-- | src/include/catalog/pg_proc.h | 50 | ||||
| -rw-r--r-- | src/include/nodes/primnodes.h | 8 | ||||
| -rw-r--r-- | src/include/storage/lock.h | 4 | ||||
| -rw-r--r-- | src/include/utils/array.h | 29 | ||||
| -rw-r--r-- | src/include/utils/builtins.h | 27 | ||||
| -rw-r--r-- | src/include/utils/numeric.h | 14 | ||||
| -rw-r--r-- | src/include/utils/timestamp.h | 4 |
11 files changed, 227 insertions, 150 deletions
diff --git a/src/include/c.h b/src/include/c.h index 603c5bbfe85..60abde17368 100644 --- a/src/include/c.h +++ b/src/include/c.h @@ -8,7 +8,7 @@ * Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: c.h,v 1.78 2000/07/12 22:59:12 petere Exp $ + * $Id: c.h,v 1.79 2000/07/17 03:05:20 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -587,6 +587,25 @@ extern Datum Float8GetDatum(float8 X); #define Float64GetDatum(X) PointerGetDatum(X) +/* + * Int64GetDatumFast + * Float4GetDatumFast + * Float8GetDatumFast + * + * These macros are intended to allow writing code that does not depend on + * whether int64, float4, float8 are pass-by-reference types, while not + * sacrificing performance when they are. The argument must be a variable + * that will exist and have the same value for as long as the Datum is needed. + * In the pass-by-ref case, the address of the variable is taken to use as + * the Datum. In the pass-by-val case, these will be the same as the non-Fast + * macros. + */ + +#define Int64GetDatumFast(X) PointerGetDatum(&(X)) +#define Float4GetDatumFast(X) PointerGetDatum(&(X)) +#define Float8GetDatumFast(X) PointerGetDatum(&(X)) + + /* ---------------------------------------------------------------- * Section 5: IsValid macros for system types * ---------------------------------------------------------------- diff --git a/src/include/catalog/catversion.h b/src/include/catalog/catversion.h index 0d4aec6c7ec..80be91a70f4 100644 --- a/src/include/catalog/catversion.h +++ b/src/include/catalog/catversion.h @@ -37,7 +37,7 @@ * Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: catversion.h,v 1.36 2000/07/07 19:24:41 petere Exp $ + * $Id: catversion.h,v 1.37 2000/07/17 03:05:23 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -53,6 +53,6 @@ */ /* yyyymmddN */ -#define CATALOG_VERSION_NO 200007071 +#define CATALOG_VERSION_NO 200007161 #endif diff --git a/src/include/catalog/pg_aggregate.h b/src/include/catalog/pg_aggregate.h index 2350d738565..1c061cd6687 100644 --- a/src/include/catalog/pg_aggregate.h +++ b/src/include/catalog/pg_aggregate.h @@ -8,7 +8,7 @@ * Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: pg_aggregate.h,v 1.26 2000/05/30 04:24:55 tgl Exp $ + * $Id: pg_aggregate.h,v 1.27 2000/07/17 03:05:23 tgl Exp $ * * NOTES * the genbki.sh script reads this file and generates .bki @@ -32,30 +32,25 @@ * cpp turns this into typedef struct FormData_pg_aggregate * * aggname name of the aggregate - * aggtransfn1 transition function 1 - * aggtransfn2 transition function 2 + * aggowner owner (creator) of the aggregate + * aggtransfn transition function * aggfinalfn final function * aggbasetype type of data on which aggregate operates - * aggtranstype1 output types for transition func 1 - * aggtranstype2 output types for transition func 2 - * aggfinaltype output type for final function - * agginitval1 initial aggregate value - * agginitval2 initial value for transition state 2 + * aggtranstype type of aggregate's transition (state) data + * aggfinaltype type of aggregate's final result + * agginitval initial value for transition state * ---------------------------------------------------------------- */ CATALOG(pg_aggregate) { NameData aggname; int4 aggowner; - regproc aggtransfn1; - regproc aggtransfn2; + regproc aggtransfn; regproc aggfinalfn; Oid aggbasetype; - Oid aggtranstype1; - Oid aggtranstype2; + Oid aggtranstype; Oid aggfinaltype; - text agginitval1; /* VARIABLE LENGTH FIELD */ - text agginitval2; /* VARIABLE LENGTH FIELD */ + text agginitval; /* VARIABLE LENGTH FIELD */ } FormData_pg_aggregate; /* ---------------- @@ -70,18 +65,15 @@ typedef FormData_pg_aggregate *Form_pg_aggregate; * ---------------- */ -#define Natts_pg_aggregate 11 +#define Natts_pg_aggregate 8 #define Anum_pg_aggregate_aggname 1 #define Anum_pg_aggregate_aggowner 2 -#define Anum_pg_aggregate_aggtransfn1 3 -#define Anum_pg_aggregate_aggtransfn2 4 -#define Anum_pg_aggregate_aggfinalfn 5 -#define Anum_pg_aggregate_aggbasetype 6 -#define Anum_pg_aggregate_aggtranstype1 7 -#define Anum_pg_aggregate_aggtranstype2 8 -#define Anum_pg_aggregate_aggfinaltype 9 -#define Anum_pg_aggregate_agginitval1 10 -#define Anum_pg_aggregate_agginitval2 11 +#define Anum_pg_aggregate_aggtransfn 3 +#define Anum_pg_aggregate_aggfinalfn 4 +#define Anum_pg_aggregate_aggbasetype 5 +#define Anum_pg_aggregate_aggtranstype 6 +#define Anum_pg_aggregate_aggfinaltype 7 +#define Anum_pg_aggregate_agginitval 8 /* ---------------- @@ -89,70 +81,84 @@ typedef FormData_pg_aggregate *Form_pg_aggregate; * --------------- */ -DATA(insert OID = 0 ( avg PGUID int8pl int4inc int84div 20 20 23 20 _null_ 0 )); -DATA(insert OID = 0 ( avg PGUID int4pl int4inc int4div 23 23 23 23 _null_ 0 )); -DATA(insert OID = 0 ( avg PGUID int2pl int2inc int2div 21 21 21 21 _null_ 0 )); -DATA(insert OID = 0 ( avg PGUID float4pl float4inc float4div 700 700 700 700 _null_ 0.0 )); -DATA(insert OID = 0 ( avg PGUID float8pl float8inc float8div 701 701 701 701 _null_ 0.0 )); -DATA(insert OID = 0 ( avg PGUID cash_pl float8inc cash_div_flt8 790 790 701 790 _null_ 0.0 )); -DATA(insert OID = 0 ( avg PGUID interval_pl float8inc interval_div 1186 1186 701 1186 _null_ 0.0 )); -DATA(insert OID = 0 ( avg PGUID numeric_add numeric_inc numeric_div 1700 1700 1700 1700 _null_ 0 )); - -DATA(insert OID = 0 ( sum PGUID int8pl - - 20 20 0 20 _null_ _null_ )); -DATA(insert OID = 0 ( sum PGUID int4pl - - 23 23 0 23 _null_ _null_ )); -DATA(insert OID = 0 ( sum PGUID int2pl - - 21 21 0 21 _null_ _null_ )); -DATA(insert OID = 0 ( sum PGUID float4pl - - 700 700 0 700 _null_ _null_ )); -DATA(insert OID = 0 ( sum PGUID float8pl - - 701 701 0 701 _null_ _null_ )); -DATA(insert OID = 0 ( sum PGUID cash_pl - - 790 790 0 790 _null_ _null_ )); -DATA(insert OID = 0 ( sum PGUID interval_pl - - 1186 1186 0 1186 _null_ _null_ )); -DATA(insert OID = 0 ( sum PGUID numeric_add - - 1700 1700 0 1700 _null_ _null_ )); - -DATA(insert OID = 0 ( max PGUID int8larger - - 20 20 0 20 _null_ _null_ )); -DATA(insert OID = 0 ( max PGUID int4larger - - 23 23 0 23 _null_ _null_ )); -DATA(insert OID = 0 ( max PGUID int2larger - - 21 21 0 21 _null_ _null_ )); -DATA(insert OID = 0 ( max PGUID float4larger - - 700 700 0 700 _null_ _null_ )); -DATA(insert OID = 0 ( max PGUID float8larger - - 701 701 0 701 _null_ _null_ )); -DATA(insert OID = 0 ( max PGUID int4larger - - 702 702 0 702 _null_ _null_ )); -DATA(insert OID = 0 ( max PGUID date_larger - - 1082 1082 0 1082 _null_ _null_ )); -DATA(insert OID = 0 ( max PGUID time_larger - - 1083 1083 0 1083 _null_ _null_ )); -DATA(insert OID = 0 ( max PGUID timetz_larger - - 1266 1266 0 1266 _null_ _null_ )); -DATA(insert OID = 0 ( max PGUID cashlarger - - 790 790 0 790 _null_ _null_ )); -DATA(insert OID = 0 ( max PGUID timestamp_larger - - 1184 1184 0 1184 _null_ _null_ )); -DATA(insert OID = 0 ( max PGUID interval_larger - - 1186 1186 0 1186 _null_ _null_ )); -DATA(insert OID = 0 ( max PGUID text_larger - - 25 25 0 25 _null_ _null_ )); -DATA(insert OID = 0 ( max PGUID numeric_larger - - 1700 1700 0 1700 _null_ _null_ )); - -DATA(insert OID = 0 ( min PGUID int8smaller - - 20 20 0 20 _null_ _null_ )); -DATA(insert OID = 0 ( min PGUID int4smaller - - 23 23 0 23 _null_ _null_ )); -DATA(insert OID = 0 ( min PGUID int2smaller - - 21 21 0 21 _null_ _null_ )); -DATA(insert OID = 0 ( min PGUID float4smaller - - 700 700 0 700 _null_ _null_ )); -DATA(insert OID = 0 ( min PGUID float8smaller - - 701 701 0 701 _null_ _null_ )); -DATA(insert OID = 0 ( min PGUID int4smaller - - 702 702 0 702 _null_ _null_ )); -DATA(insert OID = 0 ( min PGUID date_smaller - - 1082 1082 0 1082 _null_ _null_ )); -DATA(insert OID = 0 ( min PGUID time_smaller - - 1083 1083 0 1083 _null_ _null_ )); -DATA(insert OID = 0 ( min PGUID timetz_smaller - - 1266 1266 0 1266 _null_ _null_ )); -DATA(insert OID = 0 ( min PGUID cashsmaller - - 790 790 0 790 _null_ _null_ )); -DATA(insert OID = 0 ( min PGUID timestamp_smaller - - 1184 1184 0 1184 _null_ _null_ )); -DATA(insert OID = 0 ( min PGUID interval_smaller - - 1186 1186 0 1186 _null_ _null_ )); -DATA(insert OID = 0 ( min PGUID text_smaller - - 25 25 0 25 _null_ _null_ )); -DATA(insert OID = 0 ( min PGUID numeric_smaller - - 1700 1700 0 1700 _null_ _null_ )); - -DATA(insert OID = 0 ( count PGUID - int4inc - 0 0 23 23 _null_ 0 )); +DATA(insert OID = 0 ( avg PGUID int8_accum numeric_avg 20 1231 1700 "{0,0,0}" )); +DATA(insert OID = 0 ( avg PGUID int4_accum numeric_avg 23 1231 1700 "{0,0,0}" )); +DATA(insert OID = 0 ( avg PGUID int2_accum numeric_avg 21 1231 1700 "{0,0,0}" )); +DATA(insert OID = 0 ( avg PGUID numeric_accum numeric_avg 1700 1231 1700 "{0,0,0}" )); +DATA(insert OID = 0 ( avg PGUID float4_accum float8_avg 700 1022 701 "{0,0,0}" )); +DATA(insert OID = 0 ( avg PGUID float8_accum float8_avg 701 1022 701 "{0,0,0}" )); +DATA(insert OID = 0 ( avg PGUID interval_accum interval_avg 1186 1187 1186 "{0,0}" )); + +DATA(insert OID = 0 ( sum PGUID int8_sum - 20 1700 1700 _null_ )); +DATA(insert OID = 0 ( sum PGUID int4_sum - 23 1700 1700 _null_ )); +DATA(insert OID = 0 ( sum PGUID int2_sum - 21 1700 1700 _null_ )); +DATA(insert OID = 0 ( sum PGUID float4pl - 700 700 700 _null_ )); +DATA(insert OID = 0 ( sum PGUID float8pl - 701 701 701 _null_ )); +DATA(insert OID = 0 ( sum PGUID cash_pl - 790 790 790 _null_ )); +DATA(insert OID = 0 ( sum PGUID interval_pl - 1186 1186 1186 _null_ )); +DATA(insert OID = 0 ( sum PGUID numeric_add - 1700 1700 1700 _null_ )); + +DATA(insert OID = 0 ( max PGUID int8larger - 20 20 20 _null_ )); +DATA(insert OID = 0 ( max PGUID int4larger - 23 23 23 _null_ )); +DATA(insert OID = 0 ( max PGUID int2larger - 21 21 21 _null_ )); +DATA(insert OID = 0 ( max PGUID float4larger - 700 700 700 _null_ )); +DATA(insert OID = 0 ( max PGUID float8larger - 701 701 701 _null_ )); +DATA(insert OID = 0 ( max PGUID int4larger - 702 702 702 _null_ )); +DATA(insert OID = 0 ( max PGUID date_larger - 1082 1082 1082 _null_ )); +DATA(insert OID = 0 ( max PGUID time_larger - 1083 1083 1083 _null_ )); +DATA(insert OID = 0 ( max PGUID timetz_larger - 1266 1266 1266 _null_ )); +DATA(insert OID = 0 ( max PGUID cashlarger - 790 790 790 _null_ )); +DATA(insert OID = 0 ( max PGUID timestamp_larger - 1184 1184 1184 _null_ )); +DATA(insert OID = 0 ( max PGUID interval_larger - 1186 1186 1186 _null_ )); +DATA(insert OID = 0 ( max PGUID text_larger - 25 25 25 _null_ )); +DATA(insert OID = 0 ( max PGUID numeric_larger - 1700 1700 1700 _null_ )); + +DATA(insert OID = 0 ( min PGUID int8smaller - 20 20 20 _null_ )); +DATA(insert OID = 0 ( min PGUID int4smaller - 23 23 23 _null_ )); +DATA(insert OID = 0 ( min PGUID int2smaller - 21 21 21 _null_ )); +DATA(insert OID = 0 ( min PGUID float4smaller - 700 700 700 _null_ )); +DATA(insert OID = 0 ( min PGUID float8smaller - 701 701 701 _null_ )); +DATA(insert OID = 0 ( min PGUID int4smaller - 702 702 702 _null_ )); +DATA(insert OID = 0 ( min PGUID date_smaller - 1082 1082 1082 _null_ )); +DATA(insert OID = 0 ( min PGUID time_smaller - 1083 1083 1083 _null_ )); +DATA(insert OID = 0 ( min PGUID timetz_smaller - 1266 1266 1266 _null_ )); +DATA(insert OID = 0 ( min PGUID cashsmaller - 790 790 790 _null_ )); +DATA(insert OID = 0 ( min PGUID timestamp_smaller - 1184 1184 1184 _null_ )); +DATA(insert OID = 0 ( min PGUID interval_smaller - 1186 1186 1186 _null_ )); +DATA(insert OID = 0 ( min PGUID text_smaller - 25 25 25 _null_ )); +DATA(insert OID = 0 ( min PGUID numeric_smaller - 1700 1700 1700 _null_ )); + +/* + * Using int4inc for count() is cheating a little, since it really only + * takes 1 parameter not 2, but nodeAgg.c won't complain ... + */ +DATA(insert OID = 0 ( count PGUID int4inc - 0 23 23 0 )); + +DATA(insert OID = 0 ( variance PGUID int8_accum numeric_variance 20 1231 1700 "{0,0,0}" )); +DATA(insert OID = 0 ( variance PGUID int4_accum numeric_variance 23 1231 1700 "{0,0,0}" )); +DATA(insert OID = 0 ( variance PGUID int2_accum numeric_variance 21 1231 1700 "{0,0,0}" )); +DATA(insert OID = 0 ( variance PGUID float4_accum float8_variance 700 1022 701 "{0,0,0}" )); +DATA(insert OID = 0 ( variance PGUID float8_accum float8_variance 701 1022 701 "{0,0,0}" )); +DATA(insert OID = 0 ( variance PGUID numeric_accum numeric_variance 1700 1231 1700 "{0,0,0}" )); + +DATA(insert OID = 0 ( stddev PGUID int8_accum numeric_stddev 20 1231 1700 "{0,0,0}" )); +DATA(insert OID = 0 ( stddev PGUID int4_accum numeric_stddev 23 1231 1700 "{0,0,0}" )); +DATA(insert OID = 0 ( stddev PGUID int2_accum numeric_stddev 21 1231 1700 "{0,0,0}" )); +DATA(insert OID = 0 ( stddev PGUID float4_accum float8_stddev 700 1022 701 "{0,0,0}" )); +DATA(insert OID = 0 ( stddev PGUID float8_accum float8_stddev 701 1022 701 "{0,0,0}" )); +DATA(insert OID = 0 ( stddev PGUID numeric_accum numeric_stddev 1700 1231 1700 "{0,0,0}" )); /* * prototypes for functions in pg_aggregate.c */ extern void AggregateCreate(char *aggName, - char *aggtransfn1Name, - char *aggtransfn2Name, + char *aggtransfnName, char *aggfinalfnName, char *aggbasetypeName, - char *aggtransfn1typeName, - char *aggtransfn2typeName, - char *agginitval1, - char *agginitval2); + char *aggtranstypeName, + char *agginitval); extern Datum AggNameGetInitVal(char *aggName, Oid basetype, - int xfuncno, bool *isNull); + bool *isNull); #endif /* PG_AGGREGATE_H */ diff --git a/src/include/catalog/pg_operator.h b/src/include/catalog/pg_operator.h index 06bb7546cd8..20ea41ec0fb 100644 --- a/src/include/catalog/pg_operator.h +++ b/src/include/catalog/pg_operator.h @@ -8,7 +8,7 @@ * Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: pg_operator.h,v 1.76 2000/06/05 07:28:59 tgl Exp $ + * $Id: pg_operator.h,v 1.77 2000/07/17 03:05:23 tgl Exp $ * * NOTES * the genbki.sh script reads this file and generates .bki @@ -323,12 +323,12 @@ DATA(insert OID = 636 ( "-" PGUID 0 b t f 18 18 18 0 0 0 0 charmi - - )) DATA(insert OID = 637 ( "*" PGUID 0 b t f 18 18 18 0 0 0 0 charmul - - )); DATA(insert OID = 638 ( "/" PGUID 0 b t f 18 18 18 0 0 0 0 chardiv - - )); -DATA(insert OID = 639 ( "~" PGUID 0 b t f 19 25 16 0 640 0 0 nameregexeq eqsel eqjoinsel )); +DATA(insert OID = 639 ( "~" PGUID 0 b t f 19 25 16 0 640 0 0 nameregexeq regexeqsel regexeqjoinsel )); #define OID_NAME_REGEXEQ_OP 639 -DATA(insert OID = 640 ( "!~" PGUID 0 b t f 19 25 16 0 639 0 0 nameregexne neqsel neqjoinsel )); -DATA(insert OID = 641 ( "~" PGUID 0 b t f 25 25 16 0 642 0 0 textregexeq eqsel eqjoinsel )); +DATA(insert OID = 640 ( "!~" PGUID 0 b t f 19 25 16 0 639 0 0 nameregexne regexnesel regexnejoinsel )); +DATA(insert OID = 641 ( "~" PGUID 0 b t f 25 25 16 0 642 0 0 textregexeq regexeqsel regexeqjoinsel )); #define OID_TEXT_REGEXEQ_OP 641 -DATA(insert OID = 642 ( "!~" PGUID 0 b t f 25 25 16 0 641 0 0 textregexne neqsel neqjoinsel )); +DATA(insert OID = 642 ( "!~" PGUID 0 b t f 25 25 16 0 641 0 0 textregexne regexnesel regexnejoinsel )); DATA(insert OID = 643 ( "<>" PGUID 0 b t f 19 19 16 643 93 0 0 namene neqsel neqjoinsel )); DATA(insert OID = 654 ( "||" PGUID 0 b t f 25 25 25 0 0 0 0 textcat - - )); @@ -449,9 +449,9 @@ DATA(insert OID = 974 ( "||" PGUID 0 b t f 1042 1042 1042 0 0 0 0 textc DATA(insert OID = 979 ( "||" PGUID 0 b t f 1043 1043 1043 0 0 0 0 textcat - - )); DATA(insert OID = 1054 ( "=" PGUID 0 b t f 1042 1042 16 1054 1057 1058 1058 bpchareq eqsel eqjoinsel )); -DATA(insert OID = 1055 ( "~" PGUID 0 b t f 1042 25 16 0 1056 0 0 textregexeq eqsel eqjoinsel )); +DATA(insert OID = 1055 ( "~" PGUID 0 b t f 1042 25 16 0 1056 0 0 textregexeq regexeqsel regexeqjoinsel )); #define OID_BPCHAR_REGEXEQ_OP 1055 -DATA(insert OID = 1056 ( "!~" PGUID 0 b t f 1042 25 16 0 1055 0 0 textregexne neqsel neqjoinsel )); +DATA(insert OID = 1056 ( "!~" PGUID 0 b t f 1042 25 16 0 1055 0 0 textregexne regexnesel regexnejoinsel )); DATA(insert OID = 1057 ( "<>" PGUID 0 b t f 1042 1042 16 1057 1054 0 0 bpcharne neqsel neqjoinsel )); DATA(insert OID = 1058 ( "<" PGUID 0 b t f 1042 1042 16 1060 1061 0 0 bpcharlt scalarltsel scalarltjoinsel )); DATA(insert OID = 1059 ( "<=" PGUID 0 b t f 1042 1042 16 1061 1060 0 0 bpcharle scalarltsel scalarltjoinsel )); @@ -459,9 +459,9 @@ DATA(insert OID = 1060 ( ">" PGUID 0 b t f 1042 1042 16 1058 1059 0 0 bpcha DATA(insert OID = 1061 ( ">=" PGUID 0 b t f 1042 1042 16 1059 1058 0 0 bpcharge scalargtsel scalargtjoinsel )); DATA(insert OID = 1062 ( "=" PGUID 0 b t t 1043 1043 16 1062 1065 1066 1066 varchareq eqsel eqjoinsel )); -DATA(insert OID = 1063 ( "~" PGUID 0 b t f 1043 25 16 0 1064 0 0 textregexeq eqsel eqjoinsel )); +DATA(insert OID = 1063 ( "~" PGUID 0 b t f 1043 25 16 0 1064 0 0 textregexeq regexeqsel regexeqjoinsel )); #define OID_VARCHAR_REGEXEQ_OP 1063 -DATA(insert OID = 1064 ( "!~" PGUID 0 b t f 1043 25 16 0 1063 0 0 textregexne neqsel neqjoinsel )); +DATA(insert OID = 1064 ( "!~" PGUID 0 b t f 1043 25 16 0 1063 0 0 textregexne regexnesel regexnejoinsel )); DATA(insert OID = 1065 ( "<>" PGUID 0 b t f 1043 1043 16 1065 1062 0 0 varcharne neqsel neqjoinsel )); DATA(insert OID = 1066 ( "<" PGUID 0 b t f 1043 1043 16 1068 1069 0 0 varcharlt scalarltsel scalarltjoinsel )); DATA(insert OID = 1067 ( "<=" PGUID 0 b t f 1043 1043 16 1069 1068 0 0 varcharle scalarltsel scalarltjoinsel )); @@ -527,32 +527,32 @@ DATA(insert OID = 1158 ( "!" PGUID 0 r t f 21 0 23 0 0 0 0 int2fac - - )); DATA(insert OID = 1175 ( "!!" PGUID 0 l t f 0 21 23 0 0 0 0 int2fac - - )); /* LIKE hacks by Keith Parks. */ -DATA(insert OID = 1207 ( "~~" PGUID 0 b t f 19 25 16 0 1208 0 0 namelike eqsel eqjoinsel )); +DATA(insert OID = 1207 ( "~~" PGUID 0 b t f 19 25 16 0 1208 0 0 namelike likesel likejoinsel )); #define OID_NAME_LIKE_OP 1207 -DATA(insert OID = 1208 ( "!~~" PGUID 0 b t f 19 25 16 0 1207 0 0 namenlike neqsel neqjoinsel )); -DATA(insert OID = 1209 ( "~~" PGUID 0 b t f 25 25 16 0 1210 0 0 textlike eqsel eqjoinsel )); +DATA(insert OID = 1208 ( "!~~" PGUID 0 b t f 19 25 16 0 1207 0 0 namenlike nlikesel nlikejoinsel )); +DATA(insert OID = 1209 ( "~~" PGUID 0 b t f 25 25 16 0 1210 0 0 textlike likesel likejoinsel )); #define OID_TEXT_LIKE_OP 1209 -DATA(insert OID = 1210 ( "!~~" PGUID 0 b t f 25 25 16 0 1209 0 0 textnlike neqsel neqjoinsel )); -DATA(insert OID = 1211 ( "~~" PGUID 0 b t f 1042 25 16 0 1212 0 0 textlike eqsel eqjoinsel )); +DATA(insert OID = 1210 ( "!~~" PGUID 0 b t f 25 25 16 0 1209 0 0 textnlike nlikesel nlikejoinsel )); +DATA(insert OID = 1211 ( "~~" PGUID 0 b t f 1042 25 16 0 1212 0 0 textlike likesel likejoinsel )); #define OID_BPCHAR_LIKE_OP 1211 -DATA(insert OID = 1212 ( "!~~" PGUID 0 b t f 1042 25 16 0 1211 0 0 textnlike neqsel neqjoinsel )); -DATA(insert OID = 1213 ( "~~" PGUID 0 b t f 1043 25 16 0 1214 0 0 textlike eqsel eqjoinsel )); +DATA(insert OID = 1212 ( "!~~" PGUID 0 b t f 1042 25 16 0 1211 0 0 textnlike nlikesel nlikejoinsel )); +DATA(insert OID = 1213 ( "~~" PGUID 0 b t f 1043 25 16 0 1214 0 0 textlike likesel likejoinsel )); #define OID_VARCHAR_LIKE_OP 1213 -DATA(insert OID = 1214 ( "!~~" PGUID 0 b t f 1043 25 16 0 1213 0 0 textnlike neqsel neqjoinsel )); +DATA(insert OID = 1214 ( "!~~" PGUID 0 b t f 1043 25 16 0 1213 0 0 textnlike nlikesel nlikejoinsel )); /* case-insensitive LIKE hacks */ -DATA(insert OID = 1226 ( "~*" PGUID 0 b t f 19 25 16 0 1227 0 0 nameicregexeq eqsel eqjoinsel )); +DATA(insert OID = 1226 ( "~*" PGUID 0 b t f 19 25 16 0 1227 0 0 nameicregexeq icregexeqsel icregexeqjoinsel )); #define OID_NAME_ICREGEXEQ_OP 1226 -DATA(insert OID = 1227 ( "!~*" PGUID 0 b t f 19 25 16 0 1226 0 0 nameicregexne neqsel neqjoinsel )); -DATA(insert OID = 1228 ( "~*" PGUID 0 b t f 25 25 16 0 1229 0 0 texticregexeq eqsel eqjoinsel )); +DATA(insert OID = 1227 ( "!~*" PGUID 0 b t f 19 25 16 0 1226 0 0 nameicregexne icregexnesel icregexnejoinsel )); +DATA(insert OID = 1228 ( "~*" PGUID 0 b t f 25 25 16 0 1229 0 0 texticregexeq icregexeqsel icregexeqjoinsel )); #define OID_TEXT_ICREGEXEQ_OP 1228 -DATA(insert OID = 1229 ( "!~*" PGUID 0 b t f 25 25 16 0 1228 0 0 texticregexne neqsel neqjoinsel )); -DATA(insert OID = 1232 ( "~*" PGUID 0 b t f 1043 25 16 0 1233 0 0 texticregexeq eqsel eqjoinsel )); +DATA(insert OID = 1229 ( "!~*" PGUID 0 b t f 25 25 16 0 1228 0 0 texticregexne icregexnesel icregexnejoinsel )); +DATA(insert OID = 1232 ( "~*" PGUID 0 b t f 1043 25 16 0 1233 0 0 texticregexeq icregexeqsel icregexeqjoinsel )); #define OID_VARCHAR_ICREGEXEQ_OP 1232 -DATA(insert OID = 1233 ( "!~*" PGUID 0 b t f 1043 25 16 0 1232 0 0 texticregexne neqsel neqjoinsel )); -DATA(insert OID = 1234 ( "~*" PGUID 0 b t f 1042 25 16 0 1235 0 0 texticregexeq eqsel eqjoinsel )); +DATA(insert OID = 1233 ( "!~*" PGUID 0 b t f 1043 25 16 0 1232 0 0 texticregexne icregexnesel icregexnejoinsel )); +DATA(insert OID = 1234 ( "~*" PGUID 0 b t f 1042 25 16 0 1235 0 0 texticregexeq icregexeqsel icregexeqjoinsel )); #define OID_BPCHAR_ICREGEXEQ_OP 1234 -DATA(insert OID = 1235 ( "!~*" PGUID 0 b t f 1042 25 16 0 1234 0 0 texticregexne neqsel neqjoinsel )); +DATA(insert OID = 1235 ( "!~*" PGUID 0 b t f 1042 25 16 0 1234 0 0 texticregexne icregexnesel icregexnejoinsel )); /* timestamp operators */ /* name, owner, prec, kind, isleft, canhash, left, right, result, com, negate, lsortop, rsortop, oprcode, operrest, oprjoin */ diff --git a/src/include/catalog/pg_proc.h b/src/include/catalog/pg_proc.h index 538299773d9..c92ce065fb3 100644 --- a/src/include/catalog/pg_proc.h +++ b/src/include/catalog/pg_proc.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: pg_proc.h,v 1.147 2000/07/14 22:17:56 tgl Exp $ + * $Id: pg_proc.h,v 1.148 2000/07/17 03:05:25 tgl Exp $ * * NOTES * The script catalog/genbki.sh reads this file and generates .bki @@ -433,8 +433,8 @@ DATA(insert OID = 206 ( float4um PGUID 11 f t t t 1 f 700 "700" 100 0 0 100 DESCR("negate"); DATA(insert OID = 207 ( float4abs PGUID 11 f t t t 1 f 700 "700" 100 0 0 100 float4abs - )); DESCR("absolute value"); -DATA(insert OID = 208 ( float4inc PGUID 11 f t t t 1 f 700 "700" 100 0 0 100 float4inc - )); -DESCR("increment"); +DATA(insert OID = 208 ( float4_accum PGUID 12 f t t t 2 f 1022 "1022 700" 100 0 0 100 float4_accum - )); +DESCR("aggregate transition function"); DATA(insert OID = 209 ( float4larger PGUID 11 f t t t 2 f 700 "700 700" 100 0 0 100 float4larger - )); DESCR("larger of two"); DATA(insert OID = 211 ( float4smaller PGUID 11 f t t t 2 f 700 "700 700" 100 0 0 100 float4smaller - )); @@ -461,8 +461,8 @@ DATA(insert OID = 220 ( float8um PGUID 11 f t t t 1 f 701 "701" 100 0 0 100 DESCR("negate"); DATA(insert OID = 221 ( float8abs PGUID 11 f t t t 1 f 701 "701" 100 0 0 100 float8abs - )); DESCR("absolute value"); -DATA(insert OID = 222 ( float8inc PGUID 11 f t t t 1 f 701 "701" 100 0 0 100 float8inc - )); -DESCR("increment"); +DATA(insert OID = 222 ( float8_accum PGUID 12 f t t t 2 f 1022 "1022 701" 100 0 0 100 float8_accum - )); +DESCR("aggregate transition function"); DATA(insert OID = 223 ( float8larger PGUID 11 f t t t 2 f 701 "701 701" 100 0 0 100 float8larger - )); DESCR("larger of two"); DATA(insert OID = 224 ( float8smaller PGUID 11 f t t t 2 f 701 "701 701" 100 0 0 100 float8smaller - )); @@ -1004,8 +1004,6 @@ DESCR("large object export"); DATA(insert OID = 766 ( int4inc PGUID 12 f t t t 1 f 23 "23" 100 0 0 100 int4inc - )); DESCR("increment"); -DATA(insert OID = 767 ( int2inc PGUID 12 f t t t 1 f 21 "21" 100 0 0 100 int2inc - )); -DESCR("increment"); DATA(insert OID = 768 ( int4larger PGUID 12 f t t t 2 f 23 "23 23" 100 0 0 100 int4larger - )); DESCR("larger of two"); DATA(insert OID = 769 ( int4smaller PGUID 12 f t t t 2 f 23 "23 23" 100 0 0 100 int4smaller - )); @@ -1181,8 +1179,6 @@ DATA(insert OID = 944 ( char PGUID 12 f t t t 1 f 18 "25" 100 0 0 100 tex DESCR("convert text to char"); DATA(insert OID = 946 ( text PGUID 12 f t t t 1 f 25 "18" 100 0 0 100 char_text - )); DESCR("convert char to text"); -DATA(insert OID = 948 ( varchar PGUID 12 f t t t 1 f 25 "1043" 100 0 0 100 bpchar_char - )); -DESCR("convert varchar() to text"); DATA(insert OID = 950 ( istrue PGUID 12 f t t f 1 f 16 "16" 100 0 0 100 istrue - )); DESCR("bool is true (not false or unknown)"); @@ -2395,8 +2391,6 @@ DATA(insert OID = 1746 ( float8 PGUID 11 f t t t 1 f 701 "1700" 100 0 0 100 DESCR("(internal)"); DATA(insert OID = 1764 ( numeric_inc PGUID 11 f t t t 1 f 1700 "1700" 100 0 0 100 numeric_inc - )); DESCR("increment by one"); -DATA(insert OID = 1765 ( numeric_dec PGUID 11 f t t t 1 f 1700 "1700" 100 0 0 100 numeric_dec - )); -DESCR("decrement by one"); DATA(insert OID = 1766 ( numeric_smaller PGUID 11 f t t t 2 f 1700 "1700 1700" 100 0 0 100 numeric_smaller - )); DESCR("smaller of two numbers"); DATA(insert OID = 1767 ( numeric_larger PGUID 11 f t t t 2 f 1700 "1700 1700" 100 0 0 100 numeric_larger - )); @@ -2407,7 +2401,7 @@ DATA(insert OID = 1771 ( numeric_uminus PGUID 11 f t t t 1 f 1700 "1700" 100 0 DESCR("negate"); DATA(insert OID = 1779 ( int8 PGUID 11 f t t t 1 f 20 "1700" 100 0 0 100 numeric_int8 - )); DESCR("(internal)"); -DATA(insert OID = 1781 ( numeric PGUID 11 f t t t 1 f 1700 "20" 100 0 0 100 int8_numeric - )); +DATA(insert OID = 1781 ( numeric PGUID 12 f t t t 1 f 1700 "20" 100 0 0 100 int8_numeric - )); DESCR("(internal)"); DATA(insert OID = 1782 ( numeric PGUID 12 f t t t 1 f 1700 "21" 100 0 0 100 int2_numeric - )); DESCR("(internal)"); @@ -2465,6 +2459,38 @@ DESCR("join selectivity of NOT LIKE"); DATA(insert OID = 1829 ( icregexnejoinsel PGUID 12 f t f t 5 f 701 "26 26 21 26 21" 100 0 0 100 icregexnejoinsel - )); DESCR("join selectivity of case-insensitive regex non-match"); +/* Aggregate-related functions */ +DATA(insert OID = 1830 ( float8_avg PGUID 12 f t t t 1 f 701 "1022" 100 0 0 100 float8_avg - )); +DESCR("AVG aggregate final function"); +DATA(insert OID = 1831 ( float8_variance PGUID 12 f t t t 1 f 701 "1022" 100 0 0 100 float8_variance - )); +DESCR("VARIANCE aggregate final function"); +DATA(insert OID = 1832 ( float8_stddev PGUID 12 f t t t 1 f 701 "1022" 100 0 0 100 float8_stddev - )); +DESCR("STDDEV aggregate final function"); +DATA(insert OID = 1833 ( numeric_accum PGUID 12 f t t t 2 f 1231 "1231 1700" 100 0 0 100 numeric_accum - )); +DESCR("aggregate transition function"); +DATA(insert OID = 1834 ( int2_accum PGUID 12 f t t t 2 f 1231 "1231 21" 100 0 0 100 int2_accum - )); +DESCR("aggregate transition function"); +DATA(insert OID = 1835 ( int4_accum PGUID 12 f t t t 2 f 1231 "1231 23" 100 0 0 100 int4_accum - )); +DESCR("aggregate transition function"); +DATA(insert OID = 1836 ( int8_accum PGUID 12 f t t t 2 f 1231 "1231 20" 100 0 0 100 int8_accum - )); +DESCR("aggregate transition function"); +DATA(insert OID = 1837 ( numeric_avg PGUID 12 f t t t 1 f 1700 "1231" 100 0 0 100 numeric_avg - )); +DESCR("AVG aggregate final function"); +DATA(insert OID = 1838 ( numeric_variance PGUID 12 f t t t 1 f 1700 "1231" 100 0 0 100 numeric_variance - )); +DESCR("VARIANCE aggregate final function"); +DATA(insert OID = 1839 ( numeric_stddev PGUID 12 f t t t 1 f 1700 "1231" 100 0 0 100 numeric_stddev - )); +DESCR("STDDEV aggregate final function"); +DATA(insert OID = 1840 ( int2_sum PGUID 12 f t t f 2 f 1700 "1700 21" 100 0 0 100 int2_sum - )); +DESCR("SUM(int2) transition function"); +DATA(insert OID = 1841 ( int4_sum PGUID 12 f t t f 2 f 1700 "1700 23" 100 0 0 100 int4_sum - )); +DESCR("SUM(int4) transition function"); +DATA(insert OID = 1842 ( int8_sum PGUID 12 f t t f 2 f 1700 "1700 20" 100 0 0 100 int8_sum - )); +DESCR("SUM(int8) transition function"); +DATA(insert OID = 1843 ( interval_accum PGUID 12 f t t t 2 f 1187 "1187 1186" 100 0 0 100 interval_accum - )); +DESCR("aggregate transition function"); +DATA(insert OID = 1844 ( interval_avg PGUID 12 f t t t 1 f 1186 "1187" 100 0 0 100 interval_avg - )); +DESCR("AVG aggregate final function"); + /* * prototypes for functions pg_proc.c diff --git a/src/include/nodes/primnodes.h b/src/include/nodes/primnodes.h index 6f675873cc8..2cf59ca50c2 100644 --- a/src/include/nodes/primnodes.h +++ b/src/include/nodes/primnodes.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: primnodes.h,v 1.43 2000/06/12 19:40:49 momjian Exp $ + * $Id: primnodes.h,v 1.44 2000/07/17 03:05:27 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -301,10 +301,9 @@ typedef struct Iter * basetype - base type Oid of the aggregate (ie, input type) * aggtype - type Oid of final result of the aggregate * target - attribute or expression we are aggregating on - * usenulls - TRUE to accept null values as inputs * aggstar - TRUE if argument was really '*' - * aggdistinct - TRUE if arguments were labeled DISTINCT - * aggno - workspace for nodeAgg.c executor + * aggdistinct - TRUE if it's agg(DISTINCT ...) + * aggno - workspace for executor (see nodeAgg.c) * ---------------- */ typedef struct Aggref @@ -314,7 +313,6 @@ typedef struct Aggref Oid basetype; Oid aggtype; Node *target; - bool usenulls; bool aggstar; bool aggdistinct; int aggno; diff --git a/src/include/storage/lock.h b/src/include/storage/lock.h index 7ec383abe7d..195842811af 100644 --- a/src/include/storage/lock.h +++ b/src/include/storage/lock.h @@ -7,18 +7,16 @@ * Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: lock.h,v 1.38 2000/05/31 00:28:38 petere Exp $ + * $Id: lock.h,v 1.39 2000/07/17 03:05:30 tgl Exp $ * *------------------------------------------------------------------------- */ #ifndef LOCK_H_ #define LOCK_H_ -#include "postgres.h" #include "storage/ipc.h" #include "storage/itemptr.h" #include "storage/shmem.h" -#include "utils/array.h" extern SPINLOCK LockMgrLock; typedef int LOCKMASK; diff --git a/src/include/utils/array.h b/src/include/utils/array.h index 4fb296671d7..4d915e0665f 100644 --- a/src/include/utils/array.h +++ b/src/include/utils/array.h @@ -11,7 +11,7 @@ * Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: array.h,v 1.25 2000/06/13 07:35:30 tgl Exp $ + * $Id: array.h,v 1.26 2000/07/17 03:05:32 tgl Exp $ * * NOTES * XXX the data array should be MAXALIGN'd -- notice that the array @@ -24,16 +24,28 @@ #define ARRAY_H #include "fmgr.h" -#include "utils/memutils.h" +/* + * Arrays are varlena objects, so must meet the varlena convention that + * the first int32 of the object contains the total object size in bytes. + */ typedef struct { - int size; /* total array size (in bytes) */ + int32 size; /* total array size (varlena requirement) */ int ndim; /* # of dimensions */ int flags; /* implementation flags */ } ArrayType; /* + * fmgr macros for array objects + */ +#define DatumGetArrayTypeP(X) ((ArrayType *) PG_DETOAST_DATUM(X)) +#define DatumGetArrayTypePCopy(X) ((ArrayType *) PG_DETOAST_DATUM_COPY(X)) +#define PG_GETARG_ARRAYTYPE_P(n) DatumGetArrayTypeP(PG_GETARG_DATUM(n)) +#define PG_GETARG_ARRAYTYPE_P_COPY(n) DatumGetArrayTypePCopy(PG_GETARG_DATUM(n)) +#define PG_RETURN_ARRAYTYPE_P(x) PG_RETURN_POINTER(x) + +/* * bitmask of ArrayType flags field: * 1st bit - large object flag * 2nd bit - chunk flag (array is chunked if set) @@ -43,11 +55,9 @@ typedef struct #define ARR_CHK_FLAG (0x2) #define ARR_OBJ_MASK (0x1c) -#define ARR_FLAGS(a) ((ArrayType *) a)->flags #define ARR_SIZE(a) (((ArrayType *) a)->size) - #define ARR_NDIM(a) (((ArrayType *) a)->ndim) -#define ARR_NDIM_PTR(a) (&(((ArrayType *) a)->ndim)) +#define ARR_FLAGS(a) (((ArrayType *) a)->flags) #define ARR_IS_LO(a) \ (((ArrayType *) a)->flags & ARR_LOB_FLAG) @@ -102,7 +112,6 @@ typedef struct #define RETURN_NULL(type) do { *isNull = true; return (type) 0; } while (0) #define NAME_LEN 30 -#define MAX_BUFF_SIZE BLCKSZ typedef struct { @@ -134,6 +143,12 @@ extern ArrayType *array_assgn(ArrayType *array, int nSubscripts, bool elmbyval, int elmlen, bool *isNull); extern Datum array_map(FunctionCallInfo fcinfo, Oid inpType, Oid retType); +extern ArrayType *construct_array(Datum *elems, int nelems, + bool elmbyval, int elmlen, char elmalign); +extern void deconstruct_array(ArrayType *array, + bool elmbyval, int elmlen, char elmalign, + Datum **elemsp, int *nelemsp); + extern int _LOtransfer(char **destfd, int size, int nitems, char **srcfd, int isSrcLO, int isDestLO); extern char *_array_newLO(int *fd, int flag); diff --git a/src/include/utils/builtins.h b/src/include/utils/builtins.h index 07e732f1e86..db772d6ecf2 100644 --- a/src/include/utils/builtins.h +++ b/src/include/utils/builtins.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: builtins.h,v 1.123 2000/07/09 21:30:21 petere Exp $ + * $Id: builtins.h,v 1.124 2000/07/17 03:05:32 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -110,7 +110,6 @@ extern Datum int2mi(PG_FUNCTION_ARGS); extern Datum int2mul(PG_FUNCTION_ARGS); extern Datum int2div(PG_FUNCTION_ARGS); extern Datum int2abs(PG_FUNCTION_ARGS); -extern Datum int2inc(PG_FUNCTION_ARGS); extern Datum int24pl(PG_FUNCTION_ARGS); extern Datum int24mi(PG_FUNCTION_ARGS); extern Datum int24mul(PG_FUNCTION_ARGS); @@ -207,12 +206,10 @@ extern float32 float4pl(float32 arg1, float32 arg2); extern float32 float4mi(float32 arg1, float32 arg2); extern float32 float4mul(float32 arg1, float32 arg2); extern float32 float4div(float32 arg1, float32 arg2); -extern float32 float4inc(float32 arg1); extern float64 float8pl(float64 arg1, float64 arg2); extern float64 float8mi(float64 arg1, float64 arg2); extern float64 float8mul(float64 arg1, float64 arg2); extern float64 float8div(float64 arg1, float64 arg2); -extern float64 float8inc(float64 arg1); extern bool float4eq(float32 arg1, float32 arg2); extern bool float4ne(float32 arg1, float32 arg2); extern bool float4lt(float32 arg1, float32 arg2); @@ -261,6 +258,11 @@ extern float64 radians(float64 arg1); extern float64 dtan(float64 arg1); extern float64 drandom(void); extern int32 setseed(float64 seed); +extern Datum float8_accum(PG_FUNCTION_ARGS); +extern Datum float4_accum(PG_FUNCTION_ARGS); +extern Datum float8_avg(PG_FUNCTION_ARGS); +extern Datum float8_variance(PG_FUNCTION_ARGS); +extern Datum float8_stddev(PG_FUNCTION_ARGS); extern float64 float48pl(float32 arg1, float64 arg2); extern float64 float48mi(float32 arg1, float64 arg2); @@ -545,7 +547,6 @@ extern Numeric numeric_mul(Numeric num1, Numeric num2); extern Numeric numeric_div(Numeric num1, Numeric num2); extern Numeric numeric_mod(Numeric num1, Numeric num2); extern Numeric numeric_inc(Numeric num); -extern Numeric numeric_dec(Numeric num); extern Numeric numeric_smaller(Numeric num1, Numeric num2); extern Numeric numeric_larger(Numeric num1, Numeric num2); extern Numeric numeric_sqrt(Numeric num); @@ -555,14 +556,24 @@ extern Numeric numeric_log(Numeric num1, Numeric num2); extern Numeric numeric_power(Numeric num1, Numeric num2); extern Datum int4_numeric(PG_FUNCTION_ARGS); extern int32 numeric_int4(Numeric num); -extern Numeric int8_numeric(int64 *val); +extern Datum int8_numeric(PG_FUNCTION_ARGS); extern int64 *numeric_int8(Numeric num); extern Datum int2_numeric(PG_FUNCTION_ARGS); extern Datum numeric_int2(PG_FUNCTION_ARGS); -extern Numeric float4_numeric(float32 val); -extern float32 numeric_float4(Numeric num); extern Numeric float8_numeric(float64 val); extern float64 numeric_float8(Numeric num); +extern Numeric float4_numeric(float32 val); +extern float32 numeric_float4(Numeric num); +extern Datum numeric_accum(PG_FUNCTION_ARGS); +extern Datum int2_accum(PG_FUNCTION_ARGS); +extern Datum int4_accum(PG_FUNCTION_ARGS); +extern Datum int8_accum(PG_FUNCTION_ARGS); +extern Datum numeric_avg(PG_FUNCTION_ARGS); +extern Datum numeric_variance(PG_FUNCTION_ARGS); +extern Datum numeric_stddev(PG_FUNCTION_ARGS); +extern Datum int2_sum(PG_FUNCTION_ARGS); +extern Datum int4_sum(PG_FUNCTION_ARGS); +extern Datum int8_sum(PG_FUNCTION_ARGS); /* lztext.c */ extern lztext *lztextin(char *str); diff --git a/src/include/utils/numeric.h b/src/include/utils/numeric.h index 1a0dd692dbd..8e6412eabee 100644 --- a/src/include/utils/numeric.h +++ b/src/include/utils/numeric.h @@ -5,7 +5,7 @@ * * 1998 Jan Wieck * - * $Header: /cvsroot/pgsql/src/include/utils/numeric.h,v 1.10 2000/06/13 07:35:31 tgl Exp $ + * $Header: /cvsroot/pgsql/src/include/utils/numeric.h,v 1.11 2000/07/17 03:05:32 tgl Exp $ * * ---------- */ @@ -55,7 +55,7 @@ * all leading and trailing zeroes (except there will be a trailing zero * in the last byte, if the number of digits is odd). In particular, * if the value is zero, there will be no digits at all! The weight is - * arbitrary in this case, but we normally set it to zero. + * arbitrary in that case, but we normally set it to zero. * ---------- */ typedef struct NumericData @@ -75,9 +75,11 @@ typedef NumericData *Numeric; * fmgr interface macros */ -#define DatumGetNumeric(X) ((Numeric) PG_DETOAST_DATUM(X)) -#define NumericGetDatum(X) PointerGetDatum(X) -#define PG_GETARG_NUMERIC(n) DatumGetNumeric(PG_GETARG_DATUM(n)) -#define PG_RETURN_NUMERIC(x) return NumericGetDatum(x) +#define DatumGetNumeric(X) ((Numeric) PG_DETOAST_DATUM(X)) +#define DatumGetNumericCopy(X) ((Numeric) PG_DETOAST_DATUM_COPY(X)) +#define NumericGetDatum(X) PointerGetDatum(X) +#define PG_GETARG_NUMERIC(n) DatumGetNumeric(PG_GETARG_DATUM(n)) +#define PG_GETARG_NUMERIC_COPY(n) DatumGetNumericCopy(PG_GETARG_DATUM(n)) +#define PG_RETURN_NUMERIC(x) return NumericGetDatum(x) #endif /* _PG_NUMERIC_H_ */ diff --git a/src/include/utils/timestamp.h b/src/include/utils/timestamp.h index 61db8e7d206..b848c894a04 100644 --- a/src/include/utils/timestamp.h +++ b/src/include/utils/timestamp.h @@ -6,7 +6,7 @@ * Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: timestamp.h,v 1.8 2000/06/19 03:54:48 tgl Exp $ + * $Id: timestamp.h,v 1.9 2000/07/17 03:05:32 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -171,6 +171,8 @@ extern Datum interval_mi(PG_FUNCTION_ARGS); extern Datum interval_mul(PG_FUNCTION_ARGS); extern Datum mul_d_interval(PG_FUNCTION_ARGS); extern Datum interval_div(PG_FUNCTION_ARGS); +extern Datum interval_accum(PG_FUNCTION_ARGS); +extern Datum interval_avg(PG_FUNCTION_ARGS); extern Datum timestamp_mi(PG_FUNCTION_ARGS); extern Datum timestamp_pl_span(PG_FUNCTION_ARGS); |
