diff options
-rw-r--r-- | src/backend/catalog/pg_aggregate.c | 21 | ||||
-rw-r--r-- | src/backend/commands/aggregatecmds.c | 5 | ||||
-rw-r--r-- | src/backend/executor/nodeAgg.c | 91 | ||||
-rw-r--r-- | src/include/catalog/pg_aggregate.h | 250 |
4 files changed, 147 insertions, 220 deletions
diff --git a/src/backend/catalog/pg_aggregate.c b/src/backend/catalog/pg_aggregate.c index f80874d6ad..6971dc168d 100644 --- a/src/backend/catalog/pg_aggregate.c +++ b/src/backend/catalog/pg_aggregate.c @@ -54,7 +54,6 @@ AggregateCreate(const char *aggName, List *aggsortopName, Oid aggTransType, #ifdef PGXC - Oid aggCollectType, const char *agginitval, const char *agginitcollect) #else @@ -175,30 +174,25 @@ AggregateCreate(const char *aggName, #ifdef PGXC /* - * Collection function must be of two arguments - * First must be of aggCollectType, second must be of aggTransType - * Return value must be of aggCollectType + * Collection function must be of two arguments, both of type aggTransType + * and return type is also aggTransType */ - fnArgs[0] = aggCollectType; + fnArgs[0] = aggTransType; fnArgs[1] = aggTransType; collectfn = lookup_agg_function(aggcollectfnName, 2, fnArgs, &rettype); - if (rettype != aggCollectType) + if (rettype != aggTransType) ereport(ERROR, (errcode(ERRCODE_DATATYPE_MISMATCH), errmsg("return type of collection function %s is not %s", NameListToString(aggcollectfnName), - format_type_be(aggCollectType)))); + format_type_be(aggTransType)))); #endif /* handle finalfn, if supplied */ if (aggfinalfnName) { -#ifdef PGXC - fnArgs[0] = aggCollectType; -#else fnArgs[0] = aggTransType; -#endif finalfn = lookup_agg_function(aggfinalfnName, 1, fnArgs, &finaltype); } @@ -207,11 +201,7 @@ AggregateCreate(const char *aggName, /* * If no finalfn, aggregate result type is type of the state value */ -#ifdef PGXC - finaltype = aggCollectType; -#else finaltype = aggTransType; -#endif } Assert(OidIsValid(finaltype)); @@ -302,7 +292,6 @@ AggregateCreate(const char *aggName, values[Anum_pg_aggregate_aggtranstype - 1] = ObjectIdGetDatum(aggTransType); #ifdef PGXC values[Anum_pg_aggregate_aggcollectfn - 1] = ObjectIdGetDatum(collectfn); - values[Anum_pg_aggregate_aggcollecttype - 1] = ObjectIdGetDatum(aggCollectType); #endif if (agginitval) values[Anum_pg_aggregate_agginitval - 1] = CStringGetTextDatum(agginitval); diff --git a/src/backend/commands/aggregatecmds.c b/src/backend/commands/aggregatecmds.c index e73464bd4d..6b9f86ea0e 100644 --- a/src/backend/commands/aggregatecmds.c +++ b/src/backend/commands/aggregatecmds.c @@ -139,6 +139,10 @@ DefineAggregate(List *name, List *args, bool oldstyle, List *parameters) ereport(ERROR, (errcode(ERRCODE_INVALID_FUNCTION_DEFINITION), errmsg("aggregate cfunc must be specified"))); + if (collectType != transType) + ereport(ERROR, + (errcode(ERRCODE_INVALID_FUNCTION_DEFINITION), + errmsg("aggregate ctype should be same as aggregate stype"))); #endif /* @@ -247,7 +251,6 @@ DefineAggregate(List *name, List *args, bool oldstyle, List *parameters) sortoperatorName, /* sort operator name */ transTypeId, /* transition data type */ #ifdef PGXC - collectTypeId, /* collection data type */ initval, /* initial condition */ initcollect); /* initial condition for collection function */ #else diff --git a/src/backend/executor/nodeAgg.c b/src/backend/executor/nodeAgg.c index ae60a766aa..215ed5fcae 100644 --- a/src/backend/executor/nodeAgg.c +++ b/src/backend/executor/nodeAgg.c @@ -176,15 +176,9 @@ typedef struct AggStatePerAggData int16 inputtypeLen, resulttypeLen, transtypeLen; -#ifdef PGXC - int16 collecttypeLen; -#endif /* PGXC */ bool inputtypeByVal, resulttypeByVal, transtypeByVal; -#ifdef PGXC - bool collecttypeByVal; -#endif /* PGXC */ /* * Stuff for evaluation of inputs. We used to just use ExecEvalExpr, but @@ -388,6 +382,7 @@ initialize_aggregates(AggState *aggstate, * * Note that when the initial value is pass-by-ref, we must copy it * (into the aggcontext) since we will pfree the collectValue later. + * collection type is same as transition type. */ if (peraggstate->initCollectValueIsNull) pergroupstate->collectValue = peraggstate->initCollectValue; @@ -397,8 +392,8 @@ initialize_aggregates(AggState *aggstate, oldContext = MemoryContextSwitchTo(aggstate->aggcontext); pergroupstate->collectValue = datumCopy(peraggstate->initCollectValue, - peraggstate->collecttypeByVal, - peraggstate->collecttypeLen); + peraggstate->transtypeByVal, + peraggstate->transtypeLen); MemoryContextSwitchTo(oldContext); } pergroupstate->collectValueIsNull = peraggstate->initCollectValueIsNull; @@ -557,22 +552,16 @@ advance_collection_function(AggState *aggstate, if (pergroupstate->noCollectValue) { /* - * collection result has not been initialized + * collection result has not been initialized. This is the first non-NULL + * transition value. We use it as the initial value for collectValue. + * Aggregate's transition and collection type are same * We must copy the datum into result if it is pass-by-ref. We * do not need to pfree the old result, since it's NULL. - * PGXCTODO: in case the transition result type is different from - * collection result type, this code would not work, since we are - * assigning datum of one type to another. For this code to work the - * input and output of collection function needs to be binary - * compatible which is not. So, either check in AggregateCreate, - * that the input and output of collection function are binary - * coercible or set the initial values something non-null or change - * this code */ oldContext = MemoryContextSwitchTo(aggstate->aggcontext); pergroupstate->collectValue = datumCopy(fcinfo->arg[1], - peraggstate->collecttypeByVal, - peraggstate->collecttypeLen); + peraggstate->transtypeByVal, + peraggstate->transtypeLen); pergroupstate->collectValueIsNull = false; pergroupstate->noCollectValue = false; MemoryContextSwitchTo(oldContext); @@ -606,15 +595,15 @@ advance_collection_function(AggState *aggstate, * pfree the prior transValue. But if collectfn returned a pointer to its * first input, we don't need to do anything. */ - if (!peraggstate->collecttypeByVal && + if (!peraggstate->transtypeByVal && DatumGetPointer(newVal) != DatumGetPointer(pergroupstate->collectValue)) { if (!fcinfo->isnull) { MemoryContextSwitchTo(aggstate->aggcontext); newVal = datumCopy(newVal, - peraggstate->collecttypeByVal, - peraggstate->collecttypeLen); + peraggstate->transtypeByVal, + peraggstate->transtypeLen); } if (!pergroupstate->collectValueIsNull) pfree(DatumGetPointer(pergroupstate->collectValue)); @@ -909,51 +898,6 @@ finalize_aggregate(AggState *aggstate, oldContext = MemoryContextSwitchTo(aggstate->ss.ps.ps_ExprContext->ecxt_per_tuple_memory); #ifdef PGXC /* - * PGXCTODO: see PGXCTODO item in advance_collect_function - * this step is needed in case the transition function does not produce - * result consumable by final function and need collection function to be - * applied on transition function results. Usually results by both functions - * should be consumable by final function. - * As such this step is meant only to convert transition results into form - * consumable by final function, the step does not actually do any - * collection. Skipping transitionp means, that the collection - * phase is over and we need to apply final function directly. - */ - if (OidIsValid(peraggstate->collectfn_oid) && !aggstate->skip_trans) - { - FunctionCallInfoData fcinfo; - int saved_numArguments; - InitFunctionCallInfoData(fcinfo, &(peraggstate->collectfn), 2, - (void *) aggstate, NULL); - /* - * copy the initial datum since it might get changed inside the - * collection function - */ - if (peraggstate->initCollectValueIsNull) - fcinfo.arg[0] = peraggstate->initCollectValue; - else - fcinfo.arg[0] = datumCopy(peraggstate->initCollectValue, - peraggstate->collecttypeByVal, - peraggstate->collecttypeLen); - fcinfo.argnull[0] = peraggstate->initCollectValueIsNull; - fcinfo.arg[1] = pergroupstate->transValue; - fcinfo.argnull[1] = pergroupstate->transValueIsNull; - /* - * For collection function we expect only one argument other than the - * running collection result. The numArguments in peraggstate - * corresponds to the number of arguments to the aggregate, which is not - * correct for collection. Hence while applying collection function - * set numArguments to 1 and switch it back once the purpose is served. - */ - saved_numArguments = peraggstate->numArguments; - peraggstate->numArguments = 1; - advance_collection_function(aggstate, peraggstate, pergroupstate, &fcinfo); - peraggstate->numArguments = saved_numArguments; - pergroupstate->transValue = pergroupstate->collectValue; - pergroupstate->transValueIsNull = pergroupstate->collectValueIsNull; - } - - /* * if we skipped the transition phase, we have the collection result in the * collectValue, move it to transValue for finalization to work on */ @@ -1945,14 +1889,14 @@ ExecInitAgg(Agg *node, EState *estate, int eflags) Expr *dummyexpr; /* * for XC, we need to setup the collection function expression as well. - * Use the same function with invalid final function oid, and collection + * Use build_aggregate_fnexpr() with invalid final function oid, and collection * function information instead of transition function information. * PGXCTODO: we should really be adding this step inside * build_aggregate_fnexprs() but this way it becomes easy to merge. */ - build_aggregate_fnexprs(&aggform->aggtranstype, + build_aggregate_fnexprs(&aggtranstype, 1, - aggform->aggcollecttype, + aggtranstype, aggref->aggtype, collectfn_oid, InvalidOid, @@ -1985,11 +1929,6 @@ ExecInitAgg(Agg *node, EState *estate, int eflags) get_typlenbyval(aggtranstype, &peraggstate->transtypeLen, &peraggstate->transtypeByVal); -#ifdef PGXC - get_typlenbyval(aggform->aggcollecttype, - &peraggstate->collecttypeLen, - &peraggstate->collecttypeByVal); -#endif /* PGXC */ /* * initval is potentially null, so don't try to access it as a struct @@ -2019,7 +1958,7 @@ ExecInitAgg(Agg *node, EState *estate, int eflags) peraggstate->initCollectValue = (Datum) 0; else peraggstate->initCollectValue = GetAggInitVal(textInitVal, - aggform->aggcollecttype); + aggtranstype); #endif /* PGXC */ /* diff --git a/src/include/catalog/pg_aggregate.h b/src/include/catalog/pg_aggregate.h index d53a632d3d..5c2103ccc0 100644 --- a/src/include/catalog/pg_aggregate.h +++ b/src/include/catalog/pg_aggregate.h @@ -40,9 +40,6 @@ * aggfinalfn final function (0 if none) * aggsortop associated sort operator (0 if none) * aggtranstype type of aggregate's transition (state) data -#ifdef PGXC - * aggcollecttype type of aggregate's collection (state) data -#endif * agginitval initial value for transition state (can be NULL) #ifdef PGXC * agginitcollect initial value for collection state (can be NULL) @@ -58,8 +55,9 @@ CATALOG(pg_aggregate,2600) BKI_WITHOUT_OIDS regproc aggcollectfn; /* PGXC */ regproc aggfinalfn; Oid aggsortop; - Oid aggtranstype; - Oid aggcollecttype; /* PGXC */ + Oid aggtranstype; /* also serves as the input and output type + * of aggcollectfn + */ text agginitval; /* VARIABLE LENGTH FIELD */ text agginitcollect; /* PGXC, VARIABLE LENGTH FIELD */ } FormData_pg_aggregate; @@ -77,16 +75,15 @@ typedef FormData_pg_aggregate *Form_pg_aggregate; */ #ifdef PGXC -#define Natts_pg_aggregate 9 +#define Natts_pg_aggregate 8 #define Anum_pg_aggregate_aggfnoid 1 #define Anum_pg_aggregate_aggtransfn 2 #define Anum_pg_aggregate_aggcollectfn 3 #define Anum_pg_aggregate_aggfinalfn 4 #define Anum_pg_aggregate_aggsortop 5 #define Anum_pg_aggregate_aggtranstype 6 -#define Anum_pg_aggregate_aggcollecttype 7 -#define Anum_pg_aggregate_agginitval 8 -#define Anum_pg_aggregate_agginitcollect 9 +#define Anum_pg_aggregate_agginitval 7 +#define Anum_pg_aggregate_agginitcollect 8 #endif #ifdef PGXC //#define Natts_pg_aggregate 6 @@ -106,13 +103,13 @@ typedef FormData_pg_aggregate *Form_pg_aggregate; /* avg */ #ifdef PGXC -DATA(insert ( 2100 int8_avg_accum numeric_avg_collect numeric_avg 0 1231 1231 "{0,0}" "{0,0}" )); -DATA(insert ( 2101 int4_avg_accum int8_avg_collect int8_avg 0 1016 1016 "{0,0}" "{0,0}" )); -DATA(insert ( 2102 int2_avg_accum int8_avg_collect int8_avg 0 1016 1016 "{0,0}" "{0,0}" )); -DATA(insert ( 2103 numeric_avg_accum numeric_avg_collect numeric_avg 0 1231 1231 "{0,0}" "{0,0}" )); -DATA(insert ( 2104 float4_accum float8_collect float8_avg 0 1022 1022 "{0,0,0}" "{0,0,0}" )); -DATA(insert ( 2105 float8_accum float8_collect float8_avg 0 1022 1022 "{0,0,0}" "{0,0,0}" )); -DATA(insert ( 2106 interval_accum interval_collect interval_avg 0 1187 1187 "{0 second,0 second}" "{0 second,0 second}" )); +DATA(insert ( 2100 int8_avg_accum numeric_avg_collect numeric_avg 0 1231 "{0,0}" "{0,0}" )); +DATA(insert ( 2101 int4_avg_accum int8_avg_collect int8_avg 0 1016 "{0,0}" "{0,0}" )); +DATA(insert ( 2102 int2_avg_accum int8_avg_collect int8_avg 0 1016 "{0,0}" "{0,0}" )); +DATA(insert ( 2103 numeric_avg_accum numeric_avg_collect numeric_avg 0 1231 "{0,0}" "{0,0}" )); +DATA(insert ( 2104 float4_accum float8_collect float8_avg 0 1022 "{0,0,0}" "{0,0,0}" )); +DATA(insert ( 2105 float8_accum float8_collect float8_avg 0 1022 "{0,0,0}" "{0,0,0}" )); +DATA(insert ( 2106 interval_accum interval_collect interval_avg 0 1187 "{0 second,0 second}" "{0 second,0 second}" )); #endif #ifdef PGXC //DATA(insert ( 2100 int8_avg_accum numeric_avg 0 1231 "{0,0}" )); @@ -126,14 +123,14 @@ DATA(insert ( 2106 interval_accum interval_collect interval_avg 0 1187 1187 "{0 /* sum */ #ifdef PGXC -DATA(insert ( 2107 int8_sum numeric_add - 0 1700 1700 _null_ "0" )); -DATA(insert ( 2108 int4_sum int8_sum_to_int8 - 0 20 20 _null_ _null_ )); -DATA(insert ( 2109 int2_sum int8_sum_to_int8 - 0 20 20 _null_ _null_ )); -DATA(insert ( 2110 float4pl float4pl - 0 700 700 _null_ "0" )); -DATA(insert ( 2111 float8pl float8pl - 0 701 701 _null_ "0" )); -DATA(insert ( 2112 cash_pl cash_pl - 0 790 790 _null_ _null_ )); -DATA(insert ( 2113 interval_pl interval_pl - 0 1186 1186 _null_ _null_ )); -DATA(insert ( 2114 numeric_add numeric_add - 0 1700 1700 _null_ "0" )); +DATA(insert ( 2107 int8_sum numeric_add - 0 1700 _null_ "0" )); +DATA(insert ( 2108 int4_sum int8_sum_to_int8 - 0 20 _null_ _null_ )); +DATA(insert ( 2109 int2_sum int8_sum_to_int8 - 0 20 _null_ _null_ )); +DATA(insert ( 2110 float4pl float4pl - 0 700 _null_ "0" )); +DATA(insert ( 2111 float8pl float8pl - 0 701 _null_ "0" )); +DATA(insert ( 2112 cash_pl cash_pl - 0 790 _null_ _null_ )); +DATA(insert ( 2113 interval_pl interval_pl - 0 1186 _null_ _null_ )); +DATA(insert ( 2114 numeric_add numeric_add - 0 1700 _null_ "0" )); #endif #ifdef PGXC //DATA(insert ( 2107 int8_sum - 0 1700 _null_ )); @@ -148,26 +145,26 @@ DATA(insert ( 2114 numeric_add numeric_add - 0 1700 1700 _null_ "0" )); /* max */ #ifdef PGXC -DATA(insert ( 2115 int8larger int8larger - 413 20 20 _null_ _null_ )); -DATA(insert ( 2116 int4larger int4larger - 521 23 23 _null_ _null_ )); -DATA(insert ( 2117 int2larger int2larger - 520 21 21 _null_ _null_ )); -DATA(insert ( 2118 oidlarger oidlarger - 610 26 26 _null_ _null_ )); -DATA(insert ( 2119 float4larger float4larger - 623 700 700 _null_ _null_ )); -DATA(insert ( 2120 float8larger float8larger - 674 701 701 _null_ _null_ )); -DATA(insert ( 2121 int4larger int4larger - 563 702 702 _null_ _null_ )); -DATA(insert ( 2122 date_larger date_larger - 1097 1082 1082 _null_ _null_ )); -DATA(insert ( 2123 time_larger time_larger - 1112 1083 1083 _null_ _null_ )); -DATA(insert ( 2124 timetz_larger timetz_larger - 1554 1266 1266 _null_ _null_ )); -DATA(insert ( 2125 cashlarger cashlarger - 903 790 790 _null_ _null_ )); -DATA(insert ( 2126 timestamp_larger timestamp_larger - 2064 1114 1114 _null_ _null_ )); -DATA(insert ( 2127 timestamptz_larger timestamptz_larger - 1324 1184 1184 _null_ _null_ )); -DATA(insert ( 2128 interval_larger interval_larger - 1334 1186 1186 _null_ _null_ )); -DATA(insert ( 2129 text_larger text_larger - 666 25 25 _null_ _null_ )); -DATA(insert ( 2130 numeric_larger numeric_larger - 1756 1700 1700 _null_ _null_ )); -DATA(insert ( 2050 array_larger array_larger - 1073 2277 2277 _null_ _null_ )); -DATA(insert ( 2244 bpchar_larger bpchar_larger - 1060 1042 1042 _null_ _null_ )); -DATA(insert ( 2797 tidlarger tidlarger - 2800 27 27 _null_ _null_ )); -DATA(insert ( 3526 enum_larger enum_larger - 3519 3500 3500 _null_ _null_ )); +DATA(insert ( 2115 int8larger int8larger - 413 20 _null_ _null_ )); +DATA(insert ( 2116 int4larger int4larger - 521 23 _null_ _null_ )); +DATA(insert ( 2117 int2larger int2larger - 520 21 _null_ _null_ )); +DATA(insert ( 2118 oidlarger oidlarger - 610 26 _null_ _null_ )); +DATA(insert ( 2119 float4larger float4larger - 623 700 _null_ _null_ )); +DATA(insert ( 2120 float8larger float8larger - 674 701 _null_ _null_ )); +DATA(insert ( 2121 int4larger int4larger - 563 702 _null_ _null_ )); +DATA(insert ( 2122 date_larger date_larger - 1097 1082 _null_ _null_ )); +DATA(insert ( 2123 time_larger time_larger - 1112 1083 _null_ _null_ )); +DATA(insert ( 2124 timetz_larger timetz_larger - 1554 1266 _null_ _null_ )); +DATA(insert ( 2125 cashlarger cashlarger - 903 790 _null_ _null_ )); +DATA(insert ( 2126 timestamp_larger timestamp_larger - 2064 1114 _null_ _null_ )); +DATA(insert ( 2127 timestamptz_larger timestamptz_larger - 1324 1184 _null_ _null_ )); +DATA(insert ( 2128 interval_larger interval_larger - 1334 1186 _null_ _null_ )); +DATA(insert ( 2129 text_larger text_larger - 666 25 _null_ _null_ )); +DATA(insert ( 2130 numeric_larger numeric_larger - 1756 1700 _null_ _null_ )); +DATA(insert ( 2050 array_larger array_larger - 1073 2277 _null_ _null_ )); +DATA(insert ( 2244 bpchar_larger bpchar_larger - 1060 1042 _null_ _null_ )); +DATA(insert ( 2797 tidlarger tidlarger - 2800 27 _null_ _null_ )); +DATA(insert ( 3526 enum_larger enum_larger - 3519 3500 _null_ _null_ )); #endif #ifdef PGXC //DATA(insert ( 2115 int8larger - 413 20 _null_ )); @@ -194,26 +191,26 @@ DATA(insert ( 3526 enum_larger enum_larger - 3519 3500 3500 _null_ _null_ ) /* min */ #ifdef PGXC -DATA(insert ( 2131 int8smaller int8smaller - 412 20 20 _null_ _null_ )); -DATA(insert ( 2132 int4smaller int4smaller - 97 23 23 _null_ _null_ )); -DATA(insert ( 2133 int2smaller int2smaller - 95 21 21 _null_ _null_ )); -DATA(insert ( 2134 oidsmaller oidsmaller - 609 26 26 _null_ _null_ )); -DATA(insert ( 2135 float4smaller float4smaller - 622 700 700 _null_ _null_ )); -DATA(insert ( 2136 float8smaller float8smaller - 672 701 701 _null_ _null_ )); -DATA(insert ( 2137 int4smaller int4smaller - 562 702 702 _null_ _null_ )); -DATA(insert ( 2138 date_smaller date_smaller - 1095 1082 1082 _null_ _null_ )); -DATA(insert ( 2139 time_smaller time_smaller - 1110 1083 1083 _null_ _null_ )); -DATA(insert ( 2140 timetz_smaller timetz_smaller - 1552 1266 1266 _null_ _null_ )); -DATA(insert ( 2141 cashsmaller cashsmaller - 902 790 790 _null_ _null_ )); -DATA(insert ( 2142 timestamp_smaller timestamp_smaller - 2062 1114 1114 _null_ _null_ )); -DATA(insert ( 2143 timestamptz_smaller timestamptz_smaller - 1322 1184 1184 _null_ _null_ )); -DATA(insert ( 2144 interval_smaller interval_smaller - 1332 1186 1186 _null_ _null_ )); -DATA(insert ( 2145 text_smaller text_smaller - 664 25 25 _null_ _null_ )); -DATA(insert ( 2146 numeric_smaller numeric_smaller - 1754 1700 1700 _null_ _null_ )); -DATA(insert ( 2051 array_smaller array_smaller - 1072 2277 2277 _null_ _null_ )); -DATA(insert ( 2245 bpchar_smaller bpchar_smaller - 1058 1042 1042 _null_ _null_ )); -DATA(insert ( 2798 tidsmaller tidsmaller - 2799 27 27 _null_ _null_ )); -DATA(insert ( 3527 enum_smaller enum_smaller - 3518 3500 3500 _null_ _null_ )); +DATA(insert ( 2131 int8smaller int8smaller - 412 20 _null_ _null_ )); +DATA(insert ( 2132 int4smaller int4smaller - 97 23 _null_ _null_ )); +DATA(insert ( 2133 int2smaller int2smaller - 95 21 _null_ _null_ )); +DATA(insert ( 2134 oidsmaller oidsmaller - 609 26 _null_ _null_ )); +DATA(insert ( 2135 float4smaller float4smaller - 622 700 _null_ _null_ )); +DATA(insert ( 2136 float8smaller float8smaller - 672 701 _null_ _null_ )); +DATA(insert ( 2137 int4smaller int4smaller - 562 702 _null_ _null_ )); +DATA(insert ( 2138 date_smaller date_smaller - 1095 1082 _null_ _null_ )); +DATA(insert ( 2139 time_smaller time_smaller - 1110 1083 _null_ _null_ )); +DATA(insert ( 2140 timetz_smaller timetz_smaller - 1552 1266 _null_ _null_ )); +DATA(insert ( 2141 cashsmaller cashsmaller - 902 790 _null_ _null_ )); +DATA(insert ( 2142 timestamp_smaller timestamp_smaller - 2062 1114 _null_ _null_ )); +DATA(insert ( 2143 timestamptz_smaller timestamptz_smaller - 1322 1184 _null_ _null_ )); +DATA(insert ( 2144 interval_smaller interval_smaller - 1332 1186 _null_ _null_ )); +DATA(insert ( 2145 text_smaller text_smaller - 664 25 _null_ _null_ )); +DATA(insert ( 2146 numeric_smaller numeric_smaller - 1754 1700 _null_ _null_ )); +DATA(insert ( 2051 array_smaller array_smaller - 1072 2277 _null_ _null_ )); +DATA(insert ( 2245 bpchar_smaller bpchar_smaller - 1058 1042 _null_ _null_ )); +DATA(insert ( 2798 tidsmaller tidsmaller - 2799 27 _null_ _null_ )); +DATA(insert ( 3527 enum_smaller enum_smaller - 3518 3500 _null_ _null_ )); #endif #ifdef PGXC //DATA(insert ( 2131 int8smaller - 412 20 _null_ )); @@ -241,8 +238,8 @@ DATA(insert ( 3527 enum_smaller enum_smaller - 3518 3500 3500 _null_ _null_ ) /* count */ /* Final function is data type conversion function numeric_int8 is refernced by OID because of ambiguous defininition in pg_proc */ #ifdef PGXC -DATA(insert ( 2147 int8inc_any int8_sum_to_int8 - 0 20 20 "0" "0" )); -DATA(insert ( 2803 int8inc int8_sum_to_int8 - 0 20 20 "0" "0" )); +DATA(insert ( 2147 int8inc_any int8_sum_to_int8 - 0 20 "0" "0" )); +DATA(insert ( 2803 int8inc int8_sum_to_int8 - 0 20 "0" "0" )); #endif #ifdef PGXC //DATA(insert ( 2147 int8inc_any - 0 20 "0" )); @@ -251,12 +248,12 @@ DATA(insert ( 2803 int8inc int8_sum_to_int8 - 0 20 20 "0" "0" )); /* var_pop */ #ifdef PGXC -DATA(insert ( 2718 int8_accum numeric_collect numeric_var_pop 0 1231 1231 "{0,0,0}" "{0,0,0}" )); -DATA(insert ( 2719 int4_accum numeric_collect numeric_var_pop 0 1231 1231 "{0,0,0}" "{0,0,0}" )); -DATA(insert ( 2720 int2_accum numeric_collect numeric_var_pop 0 1231 1231 "{0,0,0}" "{0,0,0}" )); -DATA(insert ( 2721 float4_accum float8_collect float8_var_pop 0 1022 1022 "{0,0,0}" "{0,0,0}" )); -DATA(insert ( 2722 float8_accum float8_collect float8_var_pop 0 1022 1022 "{0,0,0}" "{0,0,0}" )); -DATA(insert ( 2723 numeric_accum numeric_collect numeric_var_pop 0 1231 1231 "{0,0,0}" "{0,0,0}" )); +DATA(insert ( 2718 int8_accum numeric_collect numeric_var_pop 0 1231 "{0,0,0}" "{0,0,0}" )); +DATA(insert ( 2719 int4_accum numeric_collect numeric_var_pop 0 1231 "{0,0,0}" "{0,0,0}" )); +DATA(insert ( 2720 int2_accum numeric_collect numeric_var_pop 0 1231 "{0,0,0}" "{0,0,0}" )); +DATA(insert ( 2721 float4_accum float8_collect float8_var_pop 0 1022 "{0,0,0}" "{0,0,0}" )); +DATA(insert ( 2722 float8_accum float8_collect float8_var_pop 0 1022 "{0,0,0}" "{0,0,0}" )); +DATA(insert ( 2723 numeric_accum numeric_collect numeric_var_pop 0 1231 "{0,0,0}" "{0,0,0}" )); #endif #ifdef PGXC //DATA(insert ( 2718 int8_accum numeric_var_pop 0 1231 "{0,0,0}" )); @@ -269,12 +266,12 @@ DATA(insert ( 2723 numeric_accum numeric_collect numeric_var_pop 0 1231 1231 "{ /* var_samp */ #ifdef PGXC -DATA(insert ( 2641 int8_accum numeric_collect numeric_var_samp 0 1231 1231 "{0,0,0}" "{0,0,0}" )); -DATA(insert ( 2642 int4_accum numeric_collect numeric_var_samp 0 1231 1231 "{0,0,0}" "{0,0,0}" )); -DATA(insert ( 2643 int2_accum numeric_collect numeric_var_samp 0 1231 1231 "{0,0,0}" "{0,0,0}" )); -DATA(insert ( 2644 float4_accum float8_collect float8_var_samp 0 1022 1022 "{0,0,0}" "{0,0,0}" )); -DATA(insert ( 2645 float8_accum float8_collect float8_var_samp 0 1022 1022 "{0,0,0}" "{0,0,0}" )); -DATA(insert ( 2646 numeric_accum numeric_collect numeric_var_samp 0 1231 1231 "{0,0,0}" "{0,0,0}" )); +DATA(insert ( 2641 int8_accum numeric_collect numeric_var_samp 0 1231 "{0,0,0}" "{0,0,0}" )); +DATA(insert ( 2642 int4_accum numeric_collect numeric_var_samp 0 1231 "{0,0,0}" "{0,0,0}" )); +DATA(insert ( 2643 int2_accum numeric_collect numeric_var_samp 0 1231 "{0,0,0}" "{0,0,0}" )); +DATA(insert ( 2644 float4_accum float8_collect float8_var_samp 0 1022 "{0,0,0}" "{0,0,0}" )); +DATA(insert ( 2645 float8_accum float8_collect float8_var_samp 0 1022 "{0,0,0}" "{0,0,0}" )); +DATA(insert ( 2646 numeric_accum numeric_collect numeric_var_samp 0 1231 "{0,0,0}" "{0,0,0}" )); #endif #ifdef PGXC //DATA(insert ( 2641 int8_accum numeric_var_samp 0 1231 "{0,0,0}" )); @@ -287,12 +284,12 @@ DATA(insert ( 2646 numeric_accum numeric_collect numeric_var_samp 0 1231 1231 "{ /* variance: historical Postgres syntax for var_samp */ #ifdef PGXC -DATA(insert ( 2148 int8_accum numeric_collect numeric_var_samp 0 1231 1231 "{0,0,0}" "{0,0,0}" )); -DATA(insert ( 2149 int4_accum numeric_collect numeric_var_samp 0 1231 1231 "{0,0,0}" "{0,0,0}" )); -DATA(insert ( 2150 int2_accum numeric_collect numeric_var_samp 0 1231 1231 "{0,0,0}" "{0,0,0}" )); -DATA(insert ( 2151 float4_accum float8_collect float8_var_samp 0 1022 1022 "{0,0,0}" "{0,0,0}" )); -DATA(insert ( 2152 float8_accum float8_collect float8_var_samp 0 1022 1022 "{0,0,0}" "{0,0,0}" )); -DATA(insert ( 2153 numeric_accum numeric_collect numeric_var_samp 0 1231 1231 "{0,0,0}" "{0,0,0}" )); +DATA(insert ( 2148 int8_accum numeric_collect numeric_var_samp 0 1231 "{0,0,0}" "{0,0,0}" )); +DATA(insert ( 2149 int4_accum numeric_collect numeric_var_samp 0 1231 "{0,0,0}" "{0,0,0}" )); +DATA(insert ( 2150 int2_accum numeric_collect numeric_var_samp 0 1231 "{0,0,0}" "{0,0,0}" )); +DATA(insert ( 2151 float4_accum float8_collect float8_var_samp 0 1022 "{0,0,0}" "{0,0,0}" )); +DATA(insert ( 2152 float8_accum float8_collect float8_var_samp 0 1022 "{0,0,0}" "{0,0,0}" )); +DATA(insert ( 2153 numeric_accum numeric_collect numeric_var_samp 0 1231 "{0,0,0}" "{0,0,0}" )); #endif #ifdef PGXC //DATA(insert ( 2148 int8_accum numeric_var_samp 0 1231 "{0,0,0}" )); @@ -305,12 +302,12 @@ DATA(insert ( 2153 numeric_accum numeric_collect numeric_var_samp 0 1231 1231 "{ /* stddev_pop */ #ifdef PGXC -DATA(insert ( 2724 int8_accum numeric_collect numeric_stddev_pop 0 1231 1231 "{0,0,0}" "{0,0,0}" )); -DATA(insert ( 2725 int4_accum numeric_collect numeric_stddev_pop 0 1231 1231 "{0,0,0}" "{0,0,0}" )); -DATA(insert ( 2726 int2_accum numeric_collect numeric_stddev_pop 0 1231 1231 "{0,0,0}" "{0,0,0}" )); -DATA(insert ( 2727 float4_accum float8_collect float8_stddev_pop 0 1022 1022 "{0,0,0}" "{0,0,0}" )); -DATA(insert ( 2728 float8_accum float8_collect float8_stddev_pop 0 1022 1022 "{0,0,0}" "{0,0,0}" )); -DATA(insert ( 2729 numeric_accum numeric_collect numeric_stddev_pop 0 1231 1231 "{0,0,0}" "{0,0,0}" )); +DATA(insert ( 2724 int8_accum numeric_collect numeric_stddev_pop 0 1231 "{0,0,0}" "{0,0,0}" )); +DATA(insert ( 2725 int4_accum numeric_collect numeric_stddev_pop 0 1231 "{0,0,0}" "{0,0,0}" )); +DATA(insert ( 2726 int2_accum numeric_collect numeric_stddev_pop 0 1231 "{0,0,0}" "{0,0,0}" )); +DATA(insert ( 2727 float4_accum float8_collect float8_stddev_pop 0 1022 "{0,0,0}" "{0,0,0}" )); +DATA(insert ( 2728 float8_accum float8_collect float8_stddev_pop 0 1022 "{0,0,0}" "{0,0,0}" )); +DATA(insert ( 2729 numeric_accum numeric_collect numeric_stddev_pop 0 1231 "{0,0,0}" "{0,0,0}" )); #endif #ifdef PGXC //DATA(insert ( 2724 int8_accum numeric_stddev_pop 0 1231 "{0,0,0}" )); @@ -323,12 +320,12 @@ DATA(insert ( 2729 numeric_accum numeric_collect numeric_stddev_pop 0 1231 1231 /* stddev_samp */ #ifdef PGXC -DATA(insert ( 2712 int8_accum numeric_collect numeric_stddev_samp 0 1231 1231 "{0,0,0}" "{0,0,0}" )); -DATA(insert ( 2713 int4_accum numeric_collect numeric_stddev_samp 0 1231 1231 "{0,0,0}" "{0,0,0}" )); -DATA(insert ( 2714 int2_accum numeric_collect numeric_stddev_samp 0 1231 1231 "{0,0,0}" "{0,0,0}" )); -DATA(insert ( 2715 float4_accum float8_collect float8_stddev_samp 0 1022 1022 "{0,0,0}" "{0,0,0}" )); -DATA(insert ( 2716 float8_accum float8_collect float8_stddev_samp 0 1022 1022 "{0,0,0}" "{0,0,0}" )); -DATA(insert ( 2717 numeric_accum numeric_collect numeric_stddev_samp 0 1231 1231 "{0,0,0}" "{0,0,0}" )); +DATA(insert ( 2712 int8_accum numeric_collect numeric_stddev_samp 0 1231 "{0,0,0}" "{0,0,0}" )); +DATA(insert ( 2713 int4_accum numeric_collect numeric_stddev_samp 0 1231 "{0,0,0}" "{0,0,0}" )); +DATA(insert ( 2714 int2_accum numeric_collect numeric_stddev_samp 0 1231 "{0,0,0}" "{0,0,0}" )); +DATA(insert ( 2715 float4_accum float8_collect float8_stddev_samp 0 1022 "{0,0,0}" "{0,0,0}" )); +DATA(insert ( 2716 float8_accum float8_collect float8_stddev_samp 0 1022 "{0,0,0}" "{0,0,0}" )); +DATA(insert ( 2717 numeric_accum numeric_collect numeric_stddev_samp 0 1231 "{0,0,0}" "{0,0,0}" )); #endif #ifdef PGXC //DATA(insert ( 2712 int8_accum numeric_stddev_samp 0 1231 "{0,0,0}" )); @@ -341,12 +338,12 @@ DATA(insert ( 2717 numeric_accum numeric_collect numeric_stddev_samp 0 1231 1231 /* stddev: historical Postgres syntax for stddev_samp */ #ifdef PGXC -DATA(insert ( 2154 int8_accum numeric_collect numeric_stddev_samp 0 1231 1231 "{0,0,0}" "{0,0,0}" )); -DATA(insert ( 2155 int4_accum numeric_collect numeric_stddev_samp 0 1231 1231 "{0,0,0}" "{0,0,0}" )); -DATA(insert ( 2156 int2_accum numeric_collect numeric_stddev_samp 0 1231 1231 "{0,0,0}" "{0,0,0}" )); -DATA(insert ( 2157 float4_accum float8_collect float8_stddev_samp 0 1022 1022 "{0,0,0}" "{0,0,0}" )); -DATA(insert ( 2158 float8_accum float8_collect float8_stddev_samp 0 1022 1022 "{0,0,0}" "{0,0,0}" )); -DATA(insert ( 2159 numeric_accum numeric_collect numeric_stddev_samp 0 1231 1231 "{0,0,0}" "{0,0,0}" )); +DATA(insert ( 2154 int8_accum numeric_collect numeric_stddev_samp 0 1231 "{0,0,0}" "{0,0,0}" )); +DATA(insert ( 2155 int4_accum numeric_collect numeric_stddev_samp 0 1231 "{0,0,0}" "{0,0,0}" )); +DATA(insert ( 2156 int2_accum numeric_collect numeric_stddev_samp 0 1231 "{0,0,0}" "{0,0,0}" )); +DATA(insert ( 2157 float4_accum float8_collect float8_stddev_samp 0 1022 "{0,0,0}" "{0,0,0}" )); +DATA(insert ( 2158 float8_accum float8_collect float8_stddev_samp 0 1022 "{0,0,0}" "{0,0,0}" )); +DATA(insert ( 2159 numeric_accum numeric_collect numeric_stddev_samp 0 1231 "{0,0,0}" "{0,0,0}" )); #endif #ifdef PGXC //DATA(insert ( 2154 int8_accum numeric_stddev_samp 0 1231 "{0,0,0}" )); @@ -359,18 +356,18 @@ DATA(insert ( 2159 numeric_accum numeric_collect numeric_stddev_samp 0 1231 1231 /* SQL2003 binary regression aggregates */ #ifdef PGXC -DATA(insert ( 2818 int8inc_float8_float8 int8_sum_to_int8 - 0 20 20 "0" _null_ )); -DATA(insert ( 2819 float8_regr_accum float8_regr_collect float8_regr_sxx 0 1022 1022 "{0,0,0,0,0,0}" "{0,0,0,0,0,0}" )); -DATA(insert ( 2820 float8_regr_accum float8_regr_collect float8_regr_syy 0 1022 1022 "{0,0,0,0,0,0}" "{0,0,0,0,0,0}" )); -DATA(insert ( 2821 float8_regr_accum float8_regr_collect float8_regr_sxy 0 1022 1022 "{0,0,0,0,0,0}" "{0,0,0,0,0,0}" )); -DATA(insert ( 2822 float8_regr_accum float8_regr_collect float8_regr_avgx 0 1022 1022 "{0,0,0,0,0,0}" "{0,0,0,0,0,0}" )); -DATA(insert ( 2823 float8_regr_accum float8_regr_collect float8_regr_avgy 0 1022 1022 "{0,0,0,0,0,0}" "{0,0,0,0,0,0}" )); -DATA(insert ( 2824 float8_regr_accum float8_regr_collect float8_regr_r2 0 1022 1022 "{0,0,0,0,0,0}" "{0,0,0,0,0,0}" )); -DATA(insert ( 2825 float8_regr_accum float8_regr_collect float8_regr_slope 0 1022 1022 "{0,0,0,0,0,0}" "{0,0,0,0,0,0}" )); -DATA(insert ( 2826 float8_regr_accum float8_regr_collect float8_regr_intercept 0 1022 1022 "{0,0,0,0,0,0}" "{0,0,0,0,0,0}" )); -DATA(insert ( 2827 float8_regr_accum float8_regr_collect float8_covar_pop 0 1022 1022 "{0,0,0,0,0,0}" "{0,0,0,0,0,0}" )); -DATA(insert ( 2828 float8_regr_accum float8_regr_collect float8_covar_samp 0 1022 1022 "{0,0,0,0,0,0}" "{0,0,0,0,0,0}" )); -DATA(insert ( 2829 float8_regr_accum float8_regr_collect float8_corr 0 1022 1022 "{0,0,0,0,0,0}" "{0,0,0,0,0,0}" )); +DATA(insert ( 2818 int8inc_float8_float8 int8_sum_to_int8 - 0 20 "0" _null_ )); +DATA(insert ( 2819 float8_regr_accum float8_regr_collect float8_regr_sxx 0 1022 "{0,0,0,0,0,0}" "{0,0,0,0,0,0}" )); +DATA(insert ( 2820 float8_regr_accum float8_regr_collect float8_regr_syy 0 1022 "{0,0,0,0,0,0}" "{0,0,0,0,0,0}" )); +DATA(insert ( 2821 float8_regr_accum float8_regr_collect float8_regr_sxy 0 1022 "{0,0,0,0,0,0}" "{0,0,0,0,0,0}" )); +DATA(insert ( 2822 float8_regr_accum float8_regr_collect float8_regr_avgx 0 1022 "{0,0,0,0,0,0}" "{0,0,0,0,0,0}" )); +DATA(insert ( 2823 float8_regr_accum float8_regr_collect float8_regr_avgy 0 1022 "{0,0,0,0,0,0}" "{0,0,0,0,0,0}" )); +DATA(insert ( 2824 float8_regr_accum float8_regr_collect float8_regr_r2 0 1022 "{0,0,0,0,0,0}" "{0,0,0,0,0,0}" )); +DATA(insert ( 2825 float8_regr_accum float8_regr_collect float8_regr_slope 0 1022 "{0,0,0,0,0,0}" "{0,0,0,0,0,0}" )); +DATA(insert ( 2826 float8_regr_accum float8_regr_collect float8_regr_intercept 0 1022 "{0,0,0,0,0,0}" "{0,0,0,0,0,0}" )); +DATA(insert ( 2827 float8_regr_accum float8_regr_collect float8_covar_pop 0 1022 "{0,0,0,0,0,0}" "{0,0,0,0,0,0}" )); +DATA(insert ( 2828 float8_regr_accum float8_regr_collect float8_covar_samp 0 1022 "{0,0,0,0,0,0}" "{0,0,0,0,0,0}" )); +DATA(insert ( 2829 float8_regr_accum float8_regr_collect float8_corr 0 1022 "{0,0,0,0,0,0}" "{0,0,0,0,0,0}" )); #endif #ifdef PGXC //DATA(insert ( 2818 int8inc_float8_float8 - 0 20 "0" )); @@ -389,9 +386,9 @@ DATA(insert ( 2829 float8_regr_accum float8_regr_collect float8_corr 0 1022 1 /* boolean-and and boolean-or */ #ifdef PGXC -DATA(insert ( 2517 booland_statefunc booland_statefunc - 0 16 16 _null_ _null_ )); -DATA(insert ( 2518 boolor_statefunc boolor_statefunc - 0 16 16 _null_ _null_ )); -DATA(insert ( 2519 booland_statefunc booland_statefunc - 0 16 16 _null_ _null_ )); +DATA(insert ( 2517 booland_statefunc booland_statefunc - 0 16 _null_ _null_ )); +DATA(insert ( 2518 boolor_statefunc boolor_statefunc - 0 16 _null_ _null_ )); +DATA(insert ( 2519 booland_statefunc booland_statefunc - 0 16 _null_ _null_ )); #endif #ifdef PGXC //DATA(insert ( 2517 booland_statefunc - 0 16 _null_ )); @@ -401,14 +398,14 @@ DATA(insert ( 2519 booland_statefunc booland_statefunc - 0 16 16 _null_ _null /* bitwise integer */ #ifdef PGXC -DATA(insert ( 2236 int2and int2and - 0 21 21 _null_ _null_ )); -DATA(insert ( 2237 int2or int2or - 0 21 21 _null_ _null_ )); -DATA(insert ( 2238 int4and int4and - 0 23 23 _null_ _null_ )); -DATA(insert ( 2239 int4or int4or - 0 23 23 _null_ _null_ )); -DATA(insert ( 2240 int8and int8and - 0 20 20 _null_ _null_ )); -DATA(insert ( 2241 int8or int8or - 0 20 20 _null_ _null_ )); -DATA(insert ( 2242 bitand bitand - 0 1560 1560 _null_ _null_ )); -DATA(insert ( 2243 bitor bitor - 0 1560 1560 _null_ _null_ )); +DATA(insert ( 2236 int2and int2and - 0 21 _null_ _null_ )); +DATA(insert ( 2237 int2or int2or - 0 21 _null_ _null_ )); +DATA(insert ( 2238 int4and int4and - 0 23 _null_ _null_ )); +DATA(insert ( 2239 int4or int4or - 0 23 _null_ _null_ )); +DATA(insert ( 2240 int8and int8and - 0 20 _null_ _null_ )); +DATA(insert ( 2241 int8or int8or - 0 20 _null_ _null_ )); +DATA(insert ( 2242 bitand bitand - 0 1560 _null_ _null_ )); +DATA(insert ( 2243 bitor bitor - 0 1560 _null_ _null_ )); #endif #ifdef PGXC //DATA(insert ( 2236 int2and - 0 21 _null_ )); @@ -423,7 +420,7 @@ DATA(insert ( 2243 bitor bitor - 0 1560 1560 _null_ _null_ )); /* xml */ #ifdef PGXC -DATA(insert ( 2901 xmlconcat2 xmlconcat2 - 0 142 142 _null_ _null_ )); +DATA(insert ( 2901 xmlconcat2 xmlconcat2 - 0 142 _null_ _null_ )); #endif #ifdef PGXC //DATA(insert ( 2901 xmlconcat2 - 0 142 _null_ )); @@ -459,7 +456,6 @@ extern void AggregateCreate(const char *aggName, List *aggsortopName, Oid aggTransType, #ifdef PGXC - Oid aggCollectType, const char *agginitval, const char *agginitcollect); #else |