diff options
author | Tomas Vondra | 2016-11-10 20:41:49 +0000 |
---|---|---|
committer | Tomas Vondra | 2016-11-10 20:41:49 +0000 |
commit | 9a9bf930c61fa640d962591da0382f3d659bf784 (patch) | |
tree | b4ee0265585ae95ebc6e435e7f409922e5650ecc | |
parent | ad71e54ecc3bb661c1fcd6ebf449be1afb68a1f9 (diff) |
remove the collect function/type from pg_aggregate
This also removes quite a bit of code from nodeAgg/nodeWindowAgg and
related bits (e.g. the collect functions themselves).
-rw-r--r-- | src/backend/catalog/pg_aggregate.c | 63 | ||||
-rw-r--r-- | src/backend/commands/aggregatecmds.c | 65 | ||||
-rw-r--r-- | src/backend/executor/nodeAgg.c | 265 | ||||
-rw-r--r-- | src/backend/executor/nodeWindowAgg.c | 30 | ||||
-rw-r--r-- | src/backend/optimizer/plan/createplan.c | 3 | ||||
-rw-r--r-- | src/backend/parser/parse_agg.c | 49 | ||||
-rw-r--r-- | src/backend/utils/adt/float.c | 130 | ||||
-rw-r--r-- | src/backend/utils/adt/json.c | 39 | ||||
-rw-r--r-- | src/backend/utils/adt/numeric.c | 504 | ||||
-rw-r--r-- | src/include/catalog/pg_aggregate.h | 339 | ||||
-rw-r--r-- | src/include/catalog/pg_proc.h | 39 | ||||
-rw-r--r-- | src/include/parser/parse_agg.h | 9 | ||||
-rw-r--r-- | src/include/utils/builtins.h | 30 |
13 files changed, 165 insertions, 1400 deletions
diff --git a/src/backend/catalog/pg_aggregate.c b/src/backend/catalog/pg_aggregate.c index 8ada7a06da..959d3845df 100644 --- a/src/backend/catalog/pg_aggregate.c +++ b/src/backend/catalog/pg_aggregate.c @@ -3,7 +3,6 @@ * pg_aggregate.c * routines to support manipulation of the pg_aggregate relation * - * Portions Copyright (c) 2012-2014, TransLattice, Inc. * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * @@ -57,9 +56,6 @@ AggregateCreate(const char *aggName, List *parameterDefaults, Oid variadicArgType, List *aggtransfnName, -#ifdef PGXC - List *aggcollectfnName, -#endif List *aggfinalfnName, List *aggcombinefnName, List *aggserialfnName, @@ -71,16 +67,10 @@ AggregateCreate(const char *aggName, bool mfinalfnExtraArgs, List *aggsortopName, Oid aggTransType, -#ifdef XCP - Oid aggCollectType, -#endif int32 aggTransSpace, Oid aggmTransType, int32 aggmTransSpace, const char *agginitval, -#ifdef PGXC - const char *agginitcollect, -#endif const char *aggminitval, char proparallel) { @@ -90,9 +80,6 @@ AggregateCreate(const char *aggName, Datum values[Natts_pg_aggregate]; Form_pg_proc proc; Oid transfn; -#ifdef PGXC - Oid collectfn = InvalidOid; /* can be omitted */ -#endif Oid finalfn = InvalidOid; /* can be omitted */ Oid combinefn = InvalidOid; /* can be omitted */ Oid serialfn = InvalidOid; /* can be omitted */ @@ -280,28 +267,6 @@ AggregateCreate(const char *aggName, ReleaseSysCache(tup); -#ifdef PGXC - if (aggcollectfnName) - { - /* - * Collection function must be of two arguments - * First must be of aggCollectType, second must be of aggTransType - * Return value must be of aggCollectType - */ - fnArgs[0] = aggCollectType; - fnArgs[1] = aggTransType; - collectfn = lookup_agg_function(aggcollectfnName, 2, fnArgs, variadicArgType, - &rettype); - if (rettype != aggCollectType) - ereport(ERROR, - (errcode(ERRCODE_DATATYPE_MISMATCH), - errmsg("return type of collection function %s is not %s", - NameListToString(aggcollectfnName), - format_type_be(aggCollectType) - ))); - } -#endif - /* handle moving-aggregate transfn, if supplied */ if (aggmtransfnName) { @@ -434,11 +399,6 @@ AggregateCreate(const char *aggName, /* * If no finalfn, aggregate result type is type of the state value */ -#ifdef XCP - if (OidIsValid(aggCollectType)) - finaltype = aggCollectType; - else -#endif finaltype = aggTransType; } Assert(OidIsValid(finaltype)); @@ -698,12 +658,6 @@ AggregateCreate(const char *aggName, values[Anum_pg_aggregate_aggmfinalextra - 1] = BoolGetDatum(mfinalfnExtraArgs); values[Anum_pg_aggregate_aggsortop - 1] = ObjectIdGetDatum(sortop); values[Anum_pg_aggregate_aggtranstype - 1] = ObjectIdGetDatum(aggTransType); -#ifdef PGXC - values[Anum_pg_aggregate_aggcollectfn - 1] = ObjectIdGetDatum(collectfn); -#endif -#ifdef XCP - values[Anum_pg_aggregate_aggcollecttype - 1] = ObjectIdGetDatum(aggCollectType); -#endif values[Anum_pg_aggregate_aggtransspace - 1] = Int32GetDatum(aggTransSpace); values[Anum_pg_aggregate_aggmtranstype - 1] = ObjectIdGetDatum(aggmTransType); values[Anum_pg_aggregate_aggmtransspace - 1] = Int32GetDatum(aggmTransSpace); @@ -711,12 +665,6 @@ AggregateCreate(const char *aggName, values[Anum_pg_aggregate_agginitval - 1] = CStringGetTextDatum(agginitval); else nulls[Anum_pg_aggregate_agginitval - 1] = true; -#ifdef PGXC - if (agginitcollect) - values[Anum_pg_aggregate_agginitcollect - 1] = CStringGetTextDatum(agginitcollect); - else - nulls[Anum_pg_aggregate_agginitcollect - 1] = true; -#endif if (aggminitval) values[Anum_pg_aggregate_aggminitval - 1] = CStringGetTextDatum(aggminitval); else @@ -745,17 +693,6 @@ AggregateCreate(const char *aggName, referenced.objectSubId = 0; recordDependencyOn(&myself, &referenced, DEPENDENCY_NORMAL); -#ifdef PGXC - if (OidIsValid(collectfn)) - { - /* Depends on collection function */ - referenced.classId = ProcedureRelationId; - referenced.objectId = collectfn; - referenced.objectSubId = 0; - recordDependencyOn(&myself, &referenced, DEPENDENCY_NORMAL); - } - -#endif /* Depends on final function, if any */ if (OidIsValid(finalfn)) { diff --git a/src/backend/commands/aggregatecmds.c b/src/backend/commands/aggregatecmds.c index 8f3037f1c9..d34c82c5ba 100644 --- a/src/backend/commands/aggregatecmds.c +++ b/src/backend/commands/aggregatecmds.c @@ -4,7 +4,6 @@ * * Routines for aggregate-manipulation commands * - * Portions Copyright (c) 2012-2014, TransLattice, Inc. * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * @@ -73,13 +72,6 @@ DefineAggregate(List *name, List *args, bool oldstyle, List *parameters, List *sortoperatorName = NIL; TypeName *baseType = NULL; TypeName *transType = NULL; -#ifdef XCP - TypeName *collectType = NULL; -#endif -#ifdef PGXC - List *collectfuncName = NIL; - char *initcollect = NULL; -#endif TypeName *mtransType = NULL; int32 transSpace = 0; int32 mtransSpace = 0; @@ -95,9 +87,6 @@ DefineAggregate(List *name, List *args, bool oldstyle, List *parameters, List *parameterDefaults; Oid variadicArgType; Oid transTypeId; -#ifdef XCP - Oid collectTypeId; -#endif Oid mtransTypeId = InvalidOid; char transTypeType; char mtransTypeType = 0; @@ -175,10 +164,6 @@ DefineAggregate(List *name, List *args, bool oldstyle, List *parameters, transType = defGetTypeName(defel); else if (pg_strcasecmp(defel->defname, "stype1") == 0) transType = defGetTypeName(defel); -#ifdef XCP - else if (pg_strcasecmp(defel->defname, "ctype") == 0) - collectType = defGetTypeName(defel); -#endif else if (pg_strcasecmp(defel->defname, "sspace") == 0) transSpace = defGetInt32(defel); else if (pg_strcasecmp(defel->defname, "mstype") == 0) @@ -189,12 +174,6 @@ DefineAggregate(List *name, List *args, bool oldstyle, List *parameters, initval = defGetString(defel); else if (pg_strcasecmp(defel->defname, "initcond1") == 0) initval = defGetString(defel); -#ifdef PGXC - else if (pg_strcasecmp(defel->defname, "cfunc") == 0) - collectfuncName = defGetQualifiedName(defel); - else if (pg_strcasecmp(defel->defname, "initcollect") == 0) - initcollect = defGetString(defel); -#endif else if (pg_strcasecmp(defel->defname, "minitcond") == 0) minitval = defGetString(defel); else if (pg_strcasecmp(defel->defname, "parallel") == 0) @@ -218,17 +197,6 @@ DefineAggregate(List *name, List *args, bool oldstyle, List *parameters, (errcode(ERRCODE_INVALID_FUNCTION_DEFINITION), errmsg("aggregate sfunc must be specified"))); -#ifdef XCP - if (collectfuncName && collectType == NULL) - ereport(ERROR, - (errcode(ERRCODE_INVALID_FUNCTION_DEFINITION), - errmsg("if aggregate cfunc is defined aggregate ctype must be specified"))); - if (collectType && collectfuncName == NIL) - ereport(ERROR, - (errcode(ERRCODE_INVALID_FUNCTION_DEFINITION), - errmsg("if aggregate ctype is defined aggregate cfunc must be specified"))); -#endif - /* * if mtransType is given, mtransfuncName and minvtransfuncName must be as * well; if not, then none of the moving-aggregate options should have @@ -361,30 +329,6 @@ DefineAggregate(List *name, List *args, bool oldstyle, List *parameters, format_type_be(transTypeId)))); } -#ifdef XCP - /* - * look up the aggregate's collecttype. - * - * to the collecttype applied all the limitations as to the transtype. - */ - if (collectType) - { - collectTypeId = typenameTypeId(NULL, collectType); - if (get_typtype(collectTypeId) == TYPTYPE_PSEUDO && - !IsPolymorphicType(collectTypeId)) - { - if (collectTypeId == INTERNALOID && superuser()) - /* okay */ ; - else - ereport(ERROR, - (errcode(ERRCODE_INVALID_FUNCTION_DEFINITION), - errmsg("aggregate collection data type cannot be %s", - format_type_be(collectTypeId)))); - } - } - else - collectTypeId = InvalidOid; -#endif if (serialfuncName && deserialfuncName) { /* @@ -486,9 +430,6 @@ DefineAggregate(List *name, List *args, bool oldstyle, List *parameters, parameterDefaults, variadicArgType, transfuncName, /* step function name */ -#ifdef PGXC - collectfuncName, /* collect function name */ -#endif finalfuncName, /* final function name */ combinefuncName, /* combine function name */ serialfuncName, /* serial function name */ @@ -500,16 +441,10 @@ DefineAggregate(List *name, List *args, bool oldstyle, List *parameters, mfinalfuncExtraArgs, sortoperatorName, /* sort operator name */ transTypeId, /* transition data type */ -#ifdef XCP - collectTypeId, /* collection data type */ -#endif transSpace, /* transition space */ mtransTypeId, /* transition data type */ mtransSpace, /* transition space */ initval, /* initial condition */ -#ifdef PGXC - initcollect, /* initial condition for collection function */ -#endif minitval, /* initial condition */ proparallel); /* parallel safe? */ } diff --git a/src/backend/executor/nodeAgg.c b/src/backend/executor/nodeAgg.c index 133ab849ae..6ad8066b33 100644 --- a/src/backend/executor/nodeAgg.c +++ b/src/backend/executor/nodeAgg.c @@ -222,9 +222,6 @@ typedef struct AggStatePerTransData /* Oid of the state transition or combine function */ Oid transfn_oid; Oid finalfn_oid; /* may be InvalidOid */ -#ifdef PGXC - Oid collectfn_oid; /* may be InvalidOid */ -#endif /* PGXC */ /* Oid of the serialization function or InvalidOid */ Oid serialfn_oid; @@ -246,9 +243,6 @@ typedef struct AggStatePerTransData */ FmgrInfo transfn; FmgrInfo finalfn; -#ifdef PGXC - FmgrInfo collectfn; -#endif /* PGXC */ /* fmgr lookup data for serialization function */ FmgrInfo serialfn; @@ -284,10 +278,6 @@ typedef struct AggStatePerTransData */ Datum initValue; bool initValueIsNull; -#ifdef PGXC - Datum initCollectValue; - bool initCollectValueIsNull; -#endif /* PGXC */ /* * We need the len and byval info for the agg's input and transition data @@ -298,15 +288,10 @@ typedef struct AggStatePerTransData */ int16 inputtypeLen, resulttypeLen, -#ifdef XCP - collecttypeLen, -#endif transtypeLen; + bool inputtypeByVal, resulttypeByVal, -#ifdef XCP - collecttypeByVal, -#endif transtypeByVal; /* @@ -433,17 +418,6 @@ typedef struct AggStatePerGroupData * NULL and not auto-replace it with a later input value. Only the first * non-NULL input will be auto-substituted. */ -#ifdef PGXC - /* - * PGXCTODO: we should be able to reuse the fields above, rather than having - * separate fields here, that can be done once we get rid of different - * collection and transition result types in pg_aggregate.h. Collection at - * Coordinator is equivalent to the transition at non-XC PG. - */ - Datum collectValue; /* current collection value */ - bool collectValueIsNull; - bool noCollectValue; /* true if the collectValue not set yet */ -#endif /* PGXC */ } AggStatePerGroupData; /* @@ -710,43 +684,6 @@ initialize_aggregate(AggState *aggstate, AggStatePerTrans pertrans, * still need to do this. */ pergroupstate->noTransValue = pertrans->initValueIsNull; - -#ifdef PGXC - /* - * (Re)set collectValue to the initial value. - * - * 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 (OidIsValid(pertrans->collectfn_oid)) - { - if (pertrans->initCollectValueIsNull) - pergroupstate->collectValue = pertrans->initCollectValue; - else - { - MemoryContext oldContext; - - oldContext = MemoryContextSwitchTo( - aggstate->aggcontexts[aggstate->current_set]->ecxt_per_tuple_memory); - pergroupstate->collectValue = datumCopy(pertrans->initCollectValue, - pertrans->transtypeByVal, - pertrans->transtypeLen); - MemoryContextSwitchTo(oldContext); - } - pergroupstate->collectValueIsNull = pertrans->initCollectValueIsNull; - - /* - * If the initial value for the transition state doesn't exist in the - * pg_aggregate table then we will let the first non-NULL value - * returned from the outer procNode become the initial value. (This is - * useful for aggregates like max() and min().) The noTransValue flag - * signals that we still need to do this. - */ - pergroupstate->noCollectValue = pertrans->initCollectValueIsNull; - } -#endif /* PGXC */ - pergroupstate->noTransValue = pertrans->initValueIsNull; } /* @@ -1376,59 +1313,11 @@ finalize_aggregate(AggState *aggstate, FunctionCallInfoData fcinfo; bool anynull = false; MemoryContext oldContext; -#ifdef XCP - Datum value; - bool isnull; -#endif int i; ListCell *lc; AggStatePerTrans pertrans = &aggstate->pertrans[peragg->transno]; oldContext = MemoryContextSwitchTo(aggstate->ss.ps.ps_ExprContext->ecxt_per_tuple_memory); -#ifdef XCP - if (OidIsValid(pertrans->collectfn_oid)) - { - FunctionCallInfoData fcinfo; - InitFunctionCallInfoData(fcinfo, &(pertrans->collectfn), 2, - pertrans->aggCollation, - (void *) aggstate, NULL); - fcinfo.arg[1] = pergroupstate->transValue; - fcinfo.argnull[1] = pergroupstate->transValueIsNull; - if (fcinfo.flinfo->fn_strict && - (pertrans->initCollectValueIsNull || pergroupstate->transValueIsNull)) - { - /* - * We have already checked the collection and transition types are - * binary compatible, so we can just copy the value. - */ - value = pergroupstate->transValue; - isnull = pergroupstate->transValueIsNull; - } - else - { - /* - * copy the initial datum since it might get changed inside the - * collection function - */ - fcinfo.argnull[0] = pertrans->initCollectValueIsNull; - fcinfo.arg[0] = (Datum) NULL; - if (!fcinfo.argnull[0]) - { - fcinfo.arg[0] = datumCopy(pertrans->initCollectValue, - pertrans->collecttypeByVal, - pertrans->collecttypeLen); - } - value = FunctionCallInvoke(&fcinfo); - isnull = fcinfo.isnull; - } - } - else - { - /* No collect function, just use transition values to finalize */ - value = pergroupstate->transValue; - isnull = pergroupstate->transValueIsNull; - } -#endif /* XCP */ /* * Evaluate any direct arguments. We do this even if there's no finalfn @@ -1463,13 +1352,8 @@ finalize_aggregate(AggState *aggstate, numFinalArgs, pertrans->aggCollation, (void *) aggstate, NULL); -#ifdef XCP - fcinfo.arg[0] = value; - fcinfo.argnull[0] = isnull; -#else fcinfo.arg[0] = pergroupstate->transValue; fcinfo.argnull[0] = pergroupstate->transValueIsNull; -#endif /* XCP */ anynull |= pergroupstate->transValueIsNull; @@ -1496,13 +1380,8 @@ finalize_aggregate(AggState *aggstate, } else { -#ifdef XCP - *resultVal = value; - *resultIsNull = isnull; -#else *resultVal = pergroupstate->transValue; *resultIsNull = pergroupstate->transValueIsNull; -#endif /* XCP */ } /* @@ -2772,16 +2651,9 @@ ExecInitAgg(Agg *node, EState *estate, int eflags) HeapTuple aggTuple; Form_pg_aggregate aggform; Oid aggtranstype; -#ifdef XCP - Oid aggcollecttype; -#endif /* XCP */ AclResult aclresult; Oid transfn_oid, finalfn_oid; -#ifdef PGXC - Oid collectfn_oid; - Expr *collectfnexpr; -#endif /* PGXC */ Expr *transfnexpr, *finalfnexpr; Oid serialfn_oid, @@ -2831,34 +2703,7 @@ ExecInitAgg(Agg *node, EState *estate, int eflags) pertrans->transfn_oid = transfn_oid = aggform->aggtransfn; pertrans->finalfn_oid = finalfn_oid = aggform->aggfinalfn; -#ifdef PGXC - pertrans->collectfn_oid = collectfn_oid = aggform->aggcollectfn; - /* - * If preparing PHASE1 skip finalization step and return transmission - * value to be collected and finalized on master node. - * If preparing PHASE2 move collection function into transition slot, - * so master node collected transition values and finalithed them. - * Otherwise (one-node aggregation) do all steps locally, the collection - * function will just convert transient value for finalization function. - */ - if (node->aggdistribution == AGG_SLAVE) - { - pertrans->collectfn_oid = collectfn_oid = InvalidOid; - pertrans->finalfn_oid = finalfn_oid = InvalidOid; - } - else if (node->aggdistribution == AGG_MASTER) - { - pertrans->transfn_oid = transfn_oid = collectfn_oid; - pertrans->collectfn_oid = collectfn_oid = InvalidOid; - - /* - * Tuples should only be filtered on the datanodes when coordinator - * is doing collection and finalisation - */ - aggref->aggfilter = NULL; - pertrans->aggfilter = NULL; - } -#endif /* PGXC */ + /* planner recorded transition state type in the Aggref itself */ aggtranstype = aggref->aggtranstype; Assert(OidIsValid(aggtranstype)); @@ -2949,16 +2794,6 @@ ExecInitAgg(Agg *node, EState *estate, int eflags) InvokeFunctionExecuteHook(finalfn_oid); } -#ifdef PGXC - if (OidIsValid(collectfn_oid)) - { - aclresult = pg_proc_aclcheck(collectfn_oid, aggOwner, - ACL_EXECUTE); - if (aclresult != ACLCHECK_OK) - aclcheck_error(aclresult, ACL_KIND_PROC, - get_func_name(collectfn_oid)); - } -#endif /* PGXC */ if (OidIsValid(serialfn_oid)) { aclresult = pg_proc_aclcheck(serialfn_oid, aggOwner, @@ -2996,45 +2831,21 @@ ExecInitAgg(Agg *node, EState *estate, int eflags) peragg->numFinalArgs = numDirectArgs + 1; /* resolve actual type of transition state, if polymorphic */ -#ifdef XCP - /* - * We substitute function for PHASE2 and should take collection type - * as transient - */ - if (node->aggdistribution == AGG_MASTER) - aggtranstype = aggform->aggcollecttype; - else -#endif /* XCP */ aggtranstype = resolve_aggregate_transtype(aggref->aggfnoid, aggform->aggtranstype, inputTypes, numArguments); -#ifdef XCP - /* get type of collection state, if defined */ - if (OidIsValid(collectfn_oid)) - aggcollecttype = aggform->aggcollecttype; - else - aggcollecttype = InvalidOid; -#endif + /* build expression trees using actual argument & result types */ build_aggregate_transfn_expr(inputTypes, numArguments, numDirectArgs, aggref->aggvariadic, aggtranstype, -#ifdef XCP - aggcollecttype, -#endif aggref->inputcollid, transfn_oid, -#ifdef XCP - collectfn_oid, -#endif InvalidOid, /* invtrans is not needed here */ &transfnexpr, -#ifdef XCP - &collectfnexpr, -#endif NULL); /* set up infrastructure for calling the transfn and finalfn */ @@ -3058,13 +2869,6 @@ ExecInitAgg(Agg *node, EState *estate, int eflags) fmgr_info_set_expr((Node *) finalfnexpr, &peragg->finalfn); } -#ifdef PGXC - if (OidIsValid(collectfn_oid)) - { - fmgr_info(collectfn_oid, &pertrans->collectfn); - pertrans->collectfn.fn_expr = (Node *)collectfnexpr; - } -#endif /* PGXC */ pertrans->aggCollation = aggref->inputcollid; InitFunctionCallInfoData(pertrans->transfn_fcinfo, @@ -3080,12 +2884,7 @@ ExecInitAgg(Agg *node, EState *estate, int eflags) get_typlenbyval(aggtranstype, &pertrans->transtypeLen, &pertrans->transtypeByVal); -#ifdef XCP - if (OidIsValid(aggcollecttype)) - get_typlenbyval(aggcollecttype, - &pertrans->collecttypeLen, - &pertrans->collecttypeByVal); -#endif /* XCP */ + /* get info about the output value's datatype */ get_typlenbyval(aggref->aggtype, &peragg->resulttypeLen, @@ -3095,16 +2894,6 @@ ExecInitAgg(Agg *node, EState *estate, int eflags) * initval is potentially null, so don't try to access it as a struct * field. Must do it the hard way with SysCacheGetAttr. */ -#ifdef XCP - /* - * If this is Phase2 get collect initial value instead - */ - if (node->aggdistribution == AGG_MASTER) - textInitVal = SysCacheGetAttr(AGGFNOID, aggTuple, - Anum_pg_aggregate_agginitcollect, - &pertrans->initValueIsNull); - else -#endif /* XCP */ textInitVal = SysCacheGetAttr(AGGFNOID, aggTuple, Anum_pg_aggregate_agginitval, &initValueIsNull); @@ -3187,10 +2976,6 @@ build_pertrans_for_aggref(AggStatePerTrans pertrans, int naggs; int i; - /* FIXME added to make the code to compile */ - HeapTuple aggTuple; - Datum textInitVal; - /* Begin filling in the pertrans data */ pertrans->aggref = aggref; pertrans->aggCollation = aggref->inputcollid; @@ -3261,14 +3046,11 @@ build_pertrans_for_aggref(AggStatePerTrans pertrans, numDirectArgs, aggref->aggvariadic, aggtranstype, - InvalidOid, /* FIXME aggcollecttype */ aggref->inputcollid, aggtransfn, - InvalidOid, /* FIXME aggcollectfn */ InvalidOid, /* no inverse transfn */ &transfnexpr, - NULL, - NULL); /* FIXME collectfnexpr*/ + NULL); fmgr_info(aggtransfn, &pertrans->transfn); fmgr_info_set_expr((Node *) transfnexpr, &pertrans->transfn); @@ -3278,43 +3060,6 @@ build_pertrans_for_aggref(AggStatePerTrans pertrans, pertrans->aggCollation, (void *) aggstate, NULL); -#ifdef PGXC - /* - * initval for collection function is potentially null, so don't try to - * access it as a struct field. Must do it the hard way with - * SysCacheGetAttr. - * - * FIXME commented out (using InvalidOid instead of aggcollecttype) to - * get the code to compile. - */ - if (OidIsValid(InvalidOid)) - { - textInitVal = SysCacheGetAttr(AGGFNOID, aggTuple, - Anum_pg_aggregate_agginitcollect, - &pertrans->initCollectValueIsNull); - if (pertrans->initCollectValueIsNull) - pertrans->initCollectValue = (Datum) 0; - else - pertrans->initCollectValue = GetAggInitVal(textInitVal, - InvalidOid); /* FIXME aggcollecttype */ - /* - * If the collectfn is strict and the initval is NULL, make sure - * transtype and collecttype are the same (or at least - * binary-compatible), so that it's OK to use the transition value - * as the initial collectValue. This should have been checked at agg - * definition time, but just in case... - */ - if (pertrans->collectfn.fn_strict && pertrans->initValueIsNull) - { - if (!IsBinaryCoercible(aggtranstype, InvalidOid)) /* FIXME aggcollecttype */ - ereport(ERROR, - (errcode(ERRCODE_INVALID_FUNCTION_DEFINITION), - errmsg("aggregate %u needs to have compatible transition type and collection type", - aggref->aggfnoid))); - } - } -#endif /* PGXC */ - /* * If the transfn is strict and the initval is NULL, make sure input * type and transtype are the same (or at least binary-compatible), so diff --git a/src/backend/executor/nodeWindowAgg.c b/src/backend/executor/nodeWindowAgg.c index 7c8259dc01..0d512543d9 100644 --- a/src/backend/executor/nodeWindowAgg.c +++ b/src/backend/executor/nodeWindowAgg.c @@ -106,9 +106,6 @@ typedef struct WindowStatePerAggData /* Oids of transition functions */ Oid transfn_oid; Oid invtransfn_oid; /* may be InvalidOid */ -#ifdef PGXC - Oid collectfn_oid; -#endif Oid finalfn_oid; /* may be InvalidOid */ /* @@ -2105,22 +2102,13 @@ initialize_peragg(WindowAggState *winstate, WindowFunc *wfunc, HeapTuple aggTuple; Form_pg_aggregate aggform; Oid aggtranstype; -#ifdef XCP - Oid aggcollecttype; -#endif AttrNumber initvalAttNo; AclResult aclresult; Oid transfn_oid, -#ifdef XCP - collectfn_oid, -#endif invtransfn_oid, finalfn_oid; bool finalextra; Expr *transfnexpr, -#ifdef XCP - *collectfnexpr, -#endif *invtransfnexpr, *finalfnexpr; Datum textInitVal; @@ -2156,9 +2144,6 @@ initialize_peragg(WindowAggState *winstate, WindowFunc *wfunc, !contain_volatile_functions((Node *) wfunc)) { peraggstate->transfn_oid = transfn_oid = aggform->aggmtransfn; -#ifdef XCP - peraggstate->collectfn_oid = collectfn_oid = InvalidOid; -#endif peraggstate->invtransfn_oid = invtransfn_oid = aggform->aggminvtransfn; peraggstate->finalfn_oid = finalfn_oid = aggform->aggmfinalfn; finalextra = aggform->aggmfinalextra; @@ -2168,9 +2153,6 @@ initialize_peragg(WindowAggState *winstate, WindowFunc *wfunc, else { peraggstate->transfn_oid = transfn_oid = aggform->aggtransfn; -#ifdef XCP - peraggstate->collectfn_oid = collectfn_oid = aggform->aggcollectfn; -#endif peraggstate->invtransfn_oid = invtransfn_oid = InvalidOid; peraggstate->finalfn_oid = finalfn_oid = aggform->aggfinalfn; finalextra = aggform->aggfinalextra; @@ -2230,9 +2212,6 @@ initialize_peragg(WindowAggState *winstate, WindowFunc *wfunc, else peraggstate->numFinalArgs = 1; -#ifdef XCP - aggcollecttype = aggform->aggcollecttype; -#endif /* resolve actual type of transition state, if polymorphic */ aggtranstype = resolve_aggregate_transtype(wfunc->winfnoid, aggtranstype, @@ -2240,21 +2219,16 @@ initialize_peragg(WindowAggState *winstate, WindowFunc *wfunc, numArguments); /* build expression trees using actual argument & result types */ - - /* build expression trees using actual argument & result types */ build_aggregate_transfn_expr(inputTypes, numArguments, 0, /* no ordered-set window functions yet */ false, /* no variadic window functions yet */ - aggtranstype, - aggcollecttype, + wfunc->wintype, wfunc->inputcollid, transfn_oid, - collectfn_oid, invtransfn_oid, &transfnexpr, - &invtransfnexpr, - &collectfnexpr); + &invtransfnexpr); /* set up infrastructure for calling the transfn(s) and finalfn */ fmgr_info(transfn_oid, &peraggstate->transfn); diff --git a/src/backend/optimizer/plan/createplan.c b/src/backend/optimizer/plan/createplan.c index b51cfa1efc..59ce512444 100644 --- a/src/backend/optimizer/plan/createplan.c +++ b/src/backend/optimizer/plan/createplan.c @@ -6483,11 +6483,10 @@ find_referenced_cols_walker(Node *node, find_referenced_cols_context *context) aggref->aggfnoid); aggform = (Form_pg_aggregate) GETSTRUCT(aggTuple); aggtranstype = aggform->aggtranstype; - aggcollecttype = aggform->aggcollecttype; ReleaseSysCache(aggTuple); /* Can not split two-phase aggregate */ - if (!OidIsValid(aggcollecttype)) + if (!OidIsValid(InvalidOid)) return true; if (IsPolymorphicType(aggtranstype)) diff --git a/src/backend/parser/parse_agg.c b/src/backend/parser/parse_agg.c index fdfd83af02..6876f2a3d4 100644 --- a/src/backend/parser/parse_agg.c +++ b/src/backend/parser/parse_agg.c @@ -1867,16 +1867,12 @@ build_aggregate_transfn_expr(Oid *agg_input_types, int agg_num_direct_inputs, bool agg_variadic, Oid agg_state_type, - Oid agg_collect_type, Oid agg_input_collation, Oid transfn_oid, - Oid collectfn_oid, Oid invtransfn_oid, Expr **transfnexpr, - Expr **invtransfnexpr, - Expr **collectfnexpr) + Expr **invtransfnexpr) { - Param *argp; List *args; FuncExpr *fexpr; int i; @@ -1920,49 +1916,6 @@ build_aggregate_transfn_expr(Oid *agg_input_types, else *invtransfnexpr = NULL; } -#ifdef XCP - /* see if we have a collect function */ - if (OidIsValid(collectfn_oid)) - { - Param *argp2; - /* - * Build expr tree for collect function - */ - argp = makeNode(Param); - argp->paramkind = PARAM_EXEC; - argp->paramid = -1; - argp->paramtype = agg_collect_type; - argp->paramtypmod = -1; - argp->location = -1; - - argp2 = makeNode(Param); - argp2->paramkind = PARAM_EXEC; - argp2->paramid = -1; - argp2->paramtype = agg_state_type; - argp2->paramtypmod = -1; - argp2->location = -1; - args = list_make2(argp, argp2); - - *collectfnexpr = (Expr *) makeFuncExpr(collectfn_oid, - agg_collect_type, - args, - InvalidOid, - agg_input_collation, - COERCE_EXPLICIT_CALL); - } - else - *collectfnexpr = NULL; -#endif - - /* see if we have a final function */ - /* - * FIXME commented out to make the code compilable after 9.6 merge - if (!OidIsValid(finalfn_oid)) - { - *finalfnexpr = NULL; - return; - } - */ } /* diff --git a/src/backend/utils/adt/float.c b/src/backend/utils/adt/float.c index e77a753cb8..8aa17e1dcb 100644 --- a/src/backend/utils/adt/float.c +++ b/src/backend/utils/adt/float.c @@ -3585,136 +3585,6 @@ width_bucket_float8(PG_FUNCTION_ARGS) PG_RETURN_INT32(result); } -#ifdef PGXC -Datum -float8_collect(PG_FUNCTION_ARGS) -{ - ArrayType *collectarray = PG_GETARG_ARRAYTYPE_P(0); - ArrayType *transarray = PG_GETARG_ARRAYTYPE_P(1); - float8 *collectvalues; - float8 *transvalues; - float8 N, - sumX, - sumX2; - - collectvalues = check_float8_array(collectarray, "float8_collect", 3); - transvalues = check_float8_array(transarray, "float8_collect", 3); - N = collectvalues[0]; - sumX = collectvalues[1]; - sumX2 = collectvalues[2]; - - N += transvalues[0]; - sumX += transvalues[1]; - CHECKFLOATVAL(sumX, isinf(collectvalues[1]) || isinf(transvalues[1]), true); - sumX2 += transvalues[2]; - CHECKFLOATVAL(sumX2, isinf(collectvalues[2]) || isinf(transvalues[2]), true); - - /* - * If we're invoked by nodeAgg, we can cheat and modify our first - * parameter in-place to reduce palloc overhead. Otherwise we construct a - * new array with the updated transition data and return it. - */ - if (fcinfo->context && - (IsA(fcinfo->context, AggState) || - IsA(fcinfo->context, WindowAggState))) - { - collectvalues[0] = N; - collectvalues[1] = sumX; - collectvalues[2] = sumX2; - - PG_RETURN_ARRAYTYPE_P(collectarray); - } - else - { - Datum collectdatums[3]; - ArrayType *result; - - collectdatums[0] = Float8GetDatumFast(N); - collectdatums[1] = Float8GetDatumFast(sumX); - collectdatums[2] = Float8GetDatumFast(sumX2); - - result = construct_array(collectdatums, 3, - FLOAT8OID, - sizeof(float8), FLOAT8PASSBYVAL, 'd'); - - PG_RETURN_ARRAYTYPE_P(result); - } -} - -Datum -float8_regr_collect(PG_FUNCTION_ARGS) -{ - ArrayType *collectarray = PG_GETARG_ARRAYTYPE_P(0); - ArrayType *transarray = PG_GETARG_ARRAYTYPE_P(1); - float8 *collectvalues; - float8 *transvalues; - float8 N, - sumX, - sumX2, - sumY, - sumY2, - sumXY; - - collectvalues = check_float8_array(collectarray, "float8_accum", 6); - transvalues = check_float8_array(transarray, "float8_accum", 6); - N = collectvalues[0]; - sumX = collectvalues[1]; - sumX2 = collectvalues[2]; - sumY = collectvalues[3]; - sumY2 = collectvalues[4]; - sumXY = collectvalues[5]; - - N += transvalues[0]; - sumX += transvalues[1]; - CHECKFLOATVAL(sumX, isinf(collectvalues[1]) || isinf(transvalues[1]), true); - sumX2 += transvalues[2]; - CHECKFLOATVAL(sumX2, isinf(collectvalues[2]) || isinf(transvalues[2]), true); - sumY += transvalues[3]; - CHECKFLOATVAL(sumY, isinf(collectvalues[3]) || isinf(transvalues[3]), true); - sumY2 += transvalues[4]; - CHECKFLOATVAL(sumY2, isinf(collectvalues[4]) || isinf(transvalues[4]), true); - sumXY += transvalues[5]; - CHECKFLOATVAL(sumXY, isinf(collectvalues[5]) || isinf(transvalues[5]), true); - - /* - * If we're invoked by nodeAgg, we can cheat and modify our first - * parameter in-place to reduce palloc overhead. Otherwise we construct a - * new array with the updated transition data and return it. - */ - if (fcinfo->context && - (IsA(fcinfo->context, AggState) || - IsA(fcinfo->context, WindowAggState))) - { - collectvalues[0] = N; - collectvalues[1] = sumX; - collectvalues[2] = sumX2; - collectvalues[3] = sumY; - collectvalues[4] = sumY2; - collectvalues[5] = sumXY; - - PG_RETURN_ARRAYTYPE_P(collectarray); - } - else - { - Datum collectdatums[6]; - ArrayType *result; - - collectdatums[0] = Float8GetDatumFast(N); - collectdatums[1] = Float8GetDatumFast(sumX); - collectdatums[2] = Float8GetDatumFast(sumX2); - collectdatums[3] = Float8GetDatumFast(sumY); - collectdatums[4] = Float8GetDatumFast(sumY2); - collectdatums[5] = Float8GetDatumFast(sumXY); - - result = construct_array(collectdatums, 6, - FLOAT8OID, - sizeof(float8), FLOAT8PASSBYVAL, 'd'); - - PG_RETURN_ARRAYTYPE_P(result); - } -} -#endif - /* ========== PRIVATE ROUTINES ========== */ #ifndef HAVE_CBRT diff --git a/src/backend/utils/adt/json.c b/src/backend/utils/adt/json.c index a591c9d1fc..32e41f5e8d 100644 --- a/src/backend/utils/adt/json.c +++ b/src/backend/utils/adt/json.c @@ -284,45 +284,6 @@ json_recv(PG_FUNCTION_ARGS) PG_RETURN_TEXT_P(cstring_to_text_with_len(str, nbytes)); } -#ifdef XCP -Datum -json_agg_state_in(PG_FUNCTION_ARGS) -{ - char *str = pstrdup(PG_GETARG_CSTRING(0)); - JsonAggState *state; - char *token, *freestr; - - state = (JsonAggState *) palloc0(sizeof (JsonAggState)); - state->str = makeStringInfo(); - - freestr = str; - - token = strsep(&str, ":"); - state->val_category = atoi(token); - appendStringInfoString(state->str, str); - - pfree(freestr); - - PG_RETURN_POINTER(state); -} - -/* - * json_agg_collectfn only needs the 'val_category' for formatting purposes. So - * only output that along with the json string - */ -Datum -json_agg_state_out(PG_FUNCTION_ARGS) -{ - JsonAggState *state = (JsonAggState *) PG_GETARG_POINTER(0); - char *result; - int len = 15 + strlen(state->str->data); - - result = (char *) palloc0(len); - sprintf(result, "%d:%s", state->val_category, state->str->data); - - PG_RETURN_CSTRING(result); -} -#endif /* * makeJsonLexContext * diff --git a/src/backend/utils/adt/numeric.c b/src/backend/utils/adt/numeric.c index 5a6a5fd058..620226cea1 100644 --- a/src/backend/utils/adt/numeric.c +++ b/src/backend/utils/adt/numeric.c @@ -3173,225 +3173,6 @@ makeNumericAggState(FunctionCallInfo fcinfo, bool calcSumX2) } /* - * numeric_agg_state_in() - - * - * Input function for numeric_agg_state data type - */ -Datum -numeric_agg_state_in(PG_FUNCTION_ARGS) -{ - char *str = pstrdup(PG_GETARG_CSTRING(0)); - NumericAggState *state; - char *token; - - state = (NumericAggState *) palloc0(sizeof (NumericAggState)); - init_var(&state->sumX); - - token = strtok(str, ":"); - state->calcSumX2 = (*token == 't'); - - token = strtok(NULL, ":"); - state->N = DatumGetInt64(DirectFunctionCall1(int8in,CStringGetDatum(token))); - - token = strtok(NULL, ":"); - set_var_from_str(token, token, &state->sumX); - - token = strtok(NULL, ":"); - if (state->calcSumX2) - { - init_var(&state->sumX2); - set_var_from_str(token, token, &state->sumX2); - } - - token = strtok(NULL, ":"); - state->maxScale = DatumGetInt32(DirectFunctionCall1(int4in,CStringGetDatum(token))); - - token = strtok(NULL, ":"); - state->maxScaleCount = DatumGetInt64(DirectFunctionCall1(int8in,CStringGetDatum(token))); - - token = strtok(NULL, ":"); - state->NaNcount = DatumGetInt64(DirectFunctionCall1(int8in,CStringGetDatum(token))); - - pfree(str); - - PG_RETURN_POINTER(state); -} - -/* - * numeric_agg_state_out() - - * - * Output function for numeric_agg_state data type - */ -Datum -numeric_agg_state_out(PG_FUNCTION_ARGS) -{ - NumericAggState *state = (NumericAggState *) PG_GETARG_POINTER(0); - char *sumX_str, *sumX2_str, *N_str, - *maxScale_str, *maxScaleCount_str, - *NaNcount_str; - char *result; - int len; - - sumX_str = get_str_from_var(&state->sumX); - if (state->calcSumX2) - sumX2_str = get_str_from_var(&state->sumX2); - else - sumX2_str = "0"; - - N_str = DatumGetCString(DirectFunctionCall1(int8out, - Int64GetDatum(state->N))); - maxScaleCount_str = DatumGetCString(DirectFunctionCall1(int8out, - Int64GetDatum(state->maxScaleCount))); - NaNcount_str = DatumGetCString(DirectFunctionCall1(int8out, - Int64GetDatum(state->NaNcount))); - maxScale_str = DatumGetCString(DirectFunctionCall1(int4out, - Int32GetDatum(state->maxScale))); - - len = 1 + strlen(N_str) + strlen(sumX_str) + strlen(sumX2_str) + - strlen(maxScale_str) + strlen(maxScaleCount_str) + - strlen(NaNcount_str) + 7; - - result = (char *) palloc0(len); - - snprintf(result, len, "%c:%s:%s:%s:%s:%s:%s", - state->calcSumX2 ? 't' : 'f', - N_str, sumX_str, sumX2_str, - maxScale_str, maxScaleCount_str, NaNcount_str); - - pfree(N_str); - pfree(sumX_str); - if (state->calcSumX2) - pfree(sumX2_str); - pfree(maxScale_str); - pfree(maxScaleCount_str); - pfree(NaNcount_str); - - PG_RETURN_CSTRING(result); -} - -/* - * numeric_agg_state_recv - converts binary format to numeric_agg_state - */ -Datum -numeric_agg_state_recv(PG_FUNCTION_ARGS) -{ - StringInfo buf = (StringInfo) PG_GETARG_POINTER(0); - NumericAggState *state; - int len; - int i; - - state = (NumericAggState *) palloc0(sizeof (NumericAggState)); - - state->calcSumX2 = pq_getmsgbyte(buf); - state->N = pq_getmsgint(buf, sizeof (int64)); - - len = (uint16) pq_getmsgint(buf, sizeof(uint16)); - if (len < 0 || len > NUMERIC_MAX_PRECISION + NUMERIC_MAX_RESULT_SCALE) - ereport(ERROR, - (errcode(ERRCODE_INVALID_BINARY_REPRESENTATION), - errmsg("invalid length in external \"numeric\" value"))); - - alloc_var(&state->sumX, len); - - state->sumX.weight = (int16) pq_getmsgint(buf, sizeof(int16)); - state->sumX.sign = (uint16) pq_getmsgint(buf, sizeof(uint16)); - if (!(state->sumX.sign == NUMERIC_POS || - state->sumX.sign == NUMERIC_NEG || - state->sumX.sign == NUMERIC_NAN)) - ereport(ERROR, - (errcode(ERRCODE_INVALID_BINARY_REPRESENTATION), - errmsg("invalid sign in external \"numeric\" value"))); - - state->sumX.dscale = (uint16) pq_getmsgint(buf, sizeof(uint16)); - for (i = 0; i < len; i++) - { - NumericDigit d = pq_getmsgint(buf, sizeof(NumericDigit)); - - if (d < 0 || d >= NBASE) - ereport(ERROR, - (errcode(ERRCODE_INVALID_BINARY_REPRESENTATION), - errmsg("invalid digit in external \"numeric\" value"))); - state->sumX.digits[i] = d; - } - - if (state->calcSumX2) - { - len = (uint16) pq_getmsgint(buf, sizeof(uint16)); - if (len < 0 || len > NUMERIC_MAX_PRECISION + NUMERIC_MAX_RESULT_SCALE) - ereport(ERROR, - (errcode(ERRCODE_INVALID_BINARY_REPRESENTATION), - errmsg("invalid length in external \"numeric\" value"))); - - alloc_var(&state->sumX2, len); - - state->sumX2.weight = (int16) pq_getmsgint(buf, sizeof(int16)); - state->sumX2.sign = (uint16) pq_getmsgint(buf, sizeof(uint16)); - if (!(state->sumX2.sign == NUMERIC_POS || - state->sumX2.sign == NUMERIC_NEG || - state->sumX2.sign == NUMERIC_NAN)) - ereport(ERROR, - (errcode(ERRCODE_INVALID_BINARY_REPRESENTATION), - errmsg("invalid sign in external \"numeric\" value"))); - - state->sumX2.dscale = (uint16) pq_getmsgint(buf, sizeof(uint16)); - for (i = 0; i < len; i++) - { - NumericDigit d = pq_getmsgint(buf, sizeof(NumericDigit)); - - if (d < 0 || d >= NBASE) - ereport(ERROR, - (errcode(ERRCODE_INVALID_BINARY_REPRESENTATION), - errmsg("invalid digit in external \"numeric\" value"))); - state->sumX2.digits[i] = d; - } - } - state->maxScale = pq_getmsgint(buf, sizeof (int)); - state->maxScaleCount = pq_getmsgint(buf, sizeof (int64)); - state->NaNcount = pq_getmsgint(buf, sizeof (int64)); - - PG_RETURN_POINTER(state); -} - -/* - * numeric_agg_state_send - converts numeric_agg_state to binary format - */ -Datum -numeric_agg_state_send(PG_FUNCTION_ARGS) -{ - NumericAggState *state = (NumericAggState *) PG_GETARG_POINTER(0); - StringInfoData buf; - int i; - - pq_begintypsend(&buf); - - pq_sendbyte(&buf, state->calcSumX2); - pq_sendint(&buf, state->N, sizeof (int64)); - - pq_sendint(&buf, state->sumX.ndigits, sizeof(int16)); - pq_sendint(&buf, state->sumX.weight, sizeof(int16)); - pq_sendint(&buf, state->sumX.sign, sizeof(int16)); - pq_sendint(&buf, state->sumX.dscale, sizeof(int16)); - for (i = 0; i < state->sumX.ndigits; i++) - pq_sendint(&buf, state->sumX.digits[i], sizeof(NumericDigit)); - - if (state->calcSumX2) - { - pq_sendint(&buf, state->sumX2.ndigits, sizeof(int16)); - pq_sendint(&buf, state->sumX2.weight, sizeof(int16)); - pq_sendint(&buf, state->sumX2.sign, sizeof(int16)); - pq_sendint(&buf, state->sumX2.dscale, sizeof(int16)); - for (i = 0; i < state->sumX2.ndigits; i++) - pq_sendint(&buf, state->sumX2.digits[i], sizeof(NumericDigit)); - } - - pq_sendint(&buf, state->maxScale, sizeof (int)); - pq_sendint(&buf, state->maxScaleCount, sizeof (int64)); - pq_sendint(&buf, state->NaNcount, sizeof (int64)); - - PG_RETURN_BYTEA_P(pq_endtypsend(&buf)); -} - -/* * Like makeNumericAggState(), but allocate the state in the current memory * context. */ @@ -5223,38 +5004,6 @@ int8_sum(PG_FUNCTION_ARGS) NumericGetDatum(oldsum), newval)); } -#ifdef PGXC -/* - * similar to int8_sum, except that the result is casted into int8 - */ -Datum -int8_sum_to_int8(PG_FUNCTION_ARGS) -{ - Datum result_num; - Datum numeric_arg; - - /* if both arguments are null, the result is null */ - if (PG_ARGISNULL(0) && PG_ARGISNULL(1)) - PG_RETURN_NULL(); - - /* if either of them is null, the other is the result */ - if (PG_ARGISNULL(0)) - PG_RETURN_DATUM(PG_GETARG_DATUM(1)); - - if (PG_ARGISNULL(1)) - PG_RETURN_DATUM(PG_GETARG_DATUM(0)); - - /* - * convert the first argument to numeric (second one is converted into - * numeric) - * add both the arguments using int8_sum - * convert the result into int8 using numeric_int8 - */ - numeric_arg = DirectFunctionCall1(int8_numeric, PG_GETARG_DATUM(0)); - result_num = DirectFunctionCall2(int8_sum, numeric_arg, PG_GETARG_DATUM(1)); - PG_RETURN_DATUM(DirectFunctionCall1(numeric_int8, result_num)); -} -#endif /* * Routines for avg(int2) and avg(int4). The transition datatype @@ -8953,256 +8702,3 @@ strip_var(NumericVar *var) var->digits = digits; var->ndigits = ndigits; } - -#ifdef PGXC -Datum -numeric_collect(PG_FUNCTION_ARGS) -{ - NumericAggState *collectstate; - NumericAggState *transstate; - MemoryContext agg_context; - MemoryContext old_context; - - if (!AggCheckCallContext(fcinfo, &agg_context)) - elog(ERROR, "aggregate function called in non-aggregate context"); - - old_context = MemoryContextSwitchTo(agg_context); - - collectstate = PG_ARGISNULL(0) ? NULL : (NumericAggState *) PG_GETARG_POINTER(0); - - if (collectstate == NULL) - { - collectstate = (NumericAggState *) palloc0(sizeof (NumericAggState)); - init_var(&collectstate->sumX); - init_var(&collectstate->sumX2); - } - - transstate = PG_ARGISNULL(1) ? NULL : (NumericAggState *) PG_GETARG_POINTER(1); - - if (transstate == NULL) - PG_RETURN_POINTER(collectstate); - - Assert(collectstate->calcSumX2 == transstate->calcSumX2); - - collectstate->N += transstate->N; - add_var(&collectstate->sumX, &transstate->sumX, &collectstate->sumX); - if (collectstate->calcSumX2) - add_var(&collectstate->sumX2, &transstate->sumX2, &collectstate->sumX2); - collectstate->NaNcount += transstate->NaNcount; - - if (collectstate->maxScale < transstate->maxScale) - { - collectstate->maxScale = transstate->maxScale; - collectstate->maxScaleCount = transstate->maxScaleCount; - } - else if (collectstate->maxScale == transstate->maxScale) - collectstate->maxScaleCount += transstate->maxScaleCount; - - MemoryContextSwitchTo(old_context); - - PG_RETURN_POINTER(collectstate); -} - -Datum -numeric_poly_collect(PG_FUNCTION_ARGS) -{ -#ifdef HAVE_INT128 - Int128AggState *collectstate; - Int128AggState *transstate; - MemoryContext agg_context; - MemoryContext old_context; - - if (!AggCheckCallContext(fcinfo, &agg_context)) - elog(ERROR, "aggregate function called in non-aggregate context"); - - old_context = MemoryContextSwitchTo(agg_context); - - collectstate = PG_ARGISNULL(0) ? NULL : (Int128AggState *) PG_GETARG_POINTER(0); - - if (collectstate == NULL) - { - collectstate = (Int128AggState *) palloc0(sizeof (Int128AggState)); - init_var(&collectstate->sumX); - init_var(&collectstate->sumX2); - } - - transstate = PG_ARGISNULL(1) ? NULL : (Int128AggState *) PG_GETARG_POINTER(1); - - if (transstate == NULL) - PG_RETURN_POINTER(collectstate); - - Assert(collectstate->calcSumX2 == transstate->calcSumX2); - - collectstate->N += transstate->N; - collectstate->sumX += transstate->sumX; - if (collectstate->calcSumX2) - collectstate->sumX2 += transstate->sumX2; - - MemoryContextSwitchTo(old_context); - - PG_RETURN_POINTER(collectstate); -#else - return numeric_collect(fcinfo); -#endif -} - - -Datum -int8_avg_collect(PG_FUNCTION_ARGS) -{ - ArrayType *collectarray; - ArrayType *transarray = PG_GETARG_ARRAYTYPE_P(1); - Int8TransTypeData *collectdata; - Int8TransTypeData *transdata; - - /* - * If we're invoked by nodeAgg, we can cheat and modify our first - * parameter in-place to reduce palloc overhead. Otherwise we need to make - * a copy of it before scribbling on it. - */ - if (fcinfo->context && - (IsA(fcinfo->context, AggState) || - IsA(fcinfo->context, WindowAggState))) - collectarray = PG_GETARG_ARRAYTYPE_P(0); - else - collectarray = PG_GETARG_ARRAYTYPE_P_COPY(0); - - if (ARR_HASNULL(collectarray) || - ARR_SIZE(collectarray) != ARR_OVERHEAD_NONULLS(1) + sizeof(Int8TransTypeData)) - elog(ERROR, "expected 2-element int8 array"); - collectdata = (Int8TransTypeData *) ARR_DATA_PTR(collectarray); - - if (ARR_HASNULL(transarray) || - ARR_SIZE(transarray) != ARR_OVERHEAD_NONULLS(1) + sizeof(Int8TransTypeData)) - elog(ERROR, "expected 2-element int8 array"); - transdata = (Int8TransTypeData *) ARR_DATA_PTR(transarray); - - collectdata->count += transdata->count; - collectdata->sum += transdata->sum; - - PG_RETURN_ARRAYTYPE_P(collectarray); -} -#endif - -/* - * numeric_poly_agg_state_in() - - * - * Input function for numeric_poly_agg_state data type - */ -Datum -numeric_poly_agg_state_in(PG_FUNCTION_ARGS) -{ -#ifdef HAVE_INT128 - char *str = pstrdup(PG_GETARG_CSTRING(0)); - Int128AggState *state; - NumericVar sumX, sumX2; - char *token; - - state = (Int128AggState *) palloc0(sizeof (Int128AggState)); - init_var(&sumX); - - token = strtok(str, ":"); - state->calcSumX2 = (*token == 't'); - - token = strtok(NULL, ":"); - state->N = DatumGetInt64(DirectFunctionCall1(int8in,CStringGetDatum(token))); - - token = strtok(NULL, ":"); - set_var_from_str(token, token, &sumX); - if (!numericvar_to_int128(&sumX, &state->sumX)) - ereport(ERROR, - (errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE), - errmsg("int128 out of range"))); - - token = strtok(NULL, ":"); - if (state->calcSumX2) - { - init_var(&sumX2); - set_var_from_str(token, token, &sumX2); - if (!numericvar_to_int128(&sumX2, &state->sumX2)) - ereport(ERROR, - (errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE), - errmsg("int128 out of range"))); - } - pfree(str); - - PG_RETURN_POINTER(state); -#else - return numeric_agg_state_in(fcinfo); -#endif -} - -/* - * numeric_poly_agg_state_out() - - * - * Output function for numeric_poly_agg_state data type - */ -Datum -numeric_poly_agg_state_out(PG_FUNCTION_ARGS) -{ -#ifdef HAVE_INT128 - Int128AggState *state = (Int128AggState *) PG_GETARG_POINTER(0); - char *N_str, *sumX_str, *sumX2_str; - char *result; - int len; - NumericVar sumX, sumX2; - - init_var(&sumX); - int128_to_numericvar(state->sumX, &sumX); - sumX_str = get_str_from_var(&sumX); - - if (state->calcSumX2) - { - init_var(&sumX2); - int128_to_numericvar(state->sumX2, &sumX2); - sumX2_str = get_str_from_var(&sumX2); - } - else - sumX2_str = "0"; - - N_str = DatumGetCString(DirectFunctionCall1(int8out, - Int64GetDatum(state->N))); - - len = 1 + strlen(N_str) + strlen(sumX_str) + strlen(sumX2_str) + 4; - result = (char *) palloc0(len); - - snprintf(result, len, "%c:%s:%s:%s", - state->calcSumX2 ? 't' : 'f', - N_str, sumX_str, sumX2_str); - - pfree(N_str); - pfree(sumX_str); - if (state->calcSumX2) - pfree(sumX2_str); - - PG_RETURN_CSTRING(result); -#else - return numeric_agg_state_out(fcinfo); -#endif -} - -/* - * numeric_poly_agg_state_recv - converts binary format to numeric_poly_agg_state - */ -Datum -numeric_poly_agg_state_recv(PG_FUNCTION_ARGS) -{ -#ifdef HAVE_INT128 - elog(ERROR, "numeric_poly_agg_state_recv not implemented"); -#else - return numeric_agg_state_recv(fcinfo); -#endif -} - -/* - * numeric_poly_agg_state_send - converts numeric_poly_agg_state to binary format - */ -Datum -numeric_poly_agg_state_send(PG_FUNCTION_ARGS) -{ -#ifdef HAVE_INT128 - elog(ERROR, "numeric_poly_agg_state_send not implemented"); -#else - return numeric_agg_state_send(fcinfo); -#endif -} diff --git a/src/include/catalog/pg_aggregate.h b/src/include/catalog/pg_aggregate.h index 0be4c0aa89..8865bba010 100644 --- a/src/include/catalog/pg_aggregate.h +++ b/src/include/catalog/pg_aggregate.h @@ -5,7 +5,6 @@ * along with the relation's initial contents. * * - * Portions Copyright (c) 2012-2014, TransLattice, Inc. * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * @@ -29,18 +28,10 @@ * * cpp turns this into typedef struct FormData_pg_aggregate * -#ifdef PGXC - * Derived from pg_aggregate, added collection function, collection data - * type and collection initial value. -#endif - * * aggfnoid pg_proc OID of the aggregate itself * aggkind aggregate kind, see AGGKIND_ categories below * aggnumdirectargs number of arguments that are "direct" arguments * aggtransfn transition function -#ifdef PGXC - * aggcollectfn collectition function -#endif * aggfinalfn final function (0 if none) * aggcombinefn combine function (0 if none) * aggserialfn function to convert transtype to bytea (0 if none) @@ -52,16 +43,10 @@ * aggmfinalextra true to pass extra dummy arguments to aggmfinalfn * 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 * aggtransspace estimated size of state data (0 for default estimate) * aggmtranstype type of moving-aggregate state data (0 if none) * aggmtransspace estimated size of moving-agg state (0 for default est) * agginitval initial value for transition state (can be NULL) -#ifdef PGXC - * agginitcollect initial value for collection state (can be NULL) -#endif * aggminitval initial value for moving-agg state (can be NULL) * ---------------------------------------------------------------- */ @@ -73,7 +58,6 @@ CATALOG(pg_aggregate,2600) BKI_WITHOUT_OIDS char aggkind; int16 aggnumdirectargs; regproc aggtransfn; - regproc aggcollectfn; /* PGXC */ regproc aggfinalfn; regproc aggcombinefn; regproc aggserialfn; @@ -85,14 +69,12 @@ CATALOG(pg_aggregate,2600) BKI_WITHOUT_OIDS bool aggmfinalextra; Oid aggsortop; Oid aggtranstype; - Oid aggcollecttype; /* PGXC */ int32 aggtransspace; Oid aggmtranstype; int32 aggmtransspace; #ifdef CATALOG_VARLEN /* variable-length fields start here */ text agginitval; - text agginitcollect; /* PGXC, VARIABLE LENGTH FIELD */ text aggminitval; #endif } FormData_pg_aggregate; @@ -114,25 +96,22 @@ typedef FormData_pg_aggregate *Form_pg_aggregate; #define Anum_pg_aggregate_aggkind 2 #define Anum_pg_aggregate_aggnumdirectargs 3 #define Anum_pg_aggregate_aggtransfn 4 -#define Anum_pg_aggregate_aggcollectfn 5 -#define Anum_pg_aggregate_aggfinalfn 6 -#define Anum_pg_aggregate_aggcombinefn 7 -#define Anum_pg_aggregate_aggserialfn 8 -#define Anum_pg_aggregate_aggdeserialfn 9 -#define Anum_pg_aggregate_aggmtransfn 10 -#define Anum_pg_aggregate_aggminvtransfn 11 -#define Anum_pg_aggregate_aggmfinalfn 12 -#define Anum_pg_aggregate_aggfinalextra 13 -#define Anum_pg_aggregate_aggmfinalextra 14 -#define Anum_pg_aggregate_aggsortop 15 -#define Anum_pg_aggregate_aggtranstype 16 -#define Anum_pg_aggregate_aggcollecttype 17 -#define Anum_pg_aggregate_aggtransspace 18 -#define Anum_pg_aggregate_aggmtranstype 19 -#define Anum_pg_aggregate_aggmtransspace 20 -#define Anum_pg_aggregate_agginitval 21 -#define Anum_pg_aggregate_agginitcollect 22 -#define Anum_pg_aggregate_aggminitval 23 +#define Anum_pg_aggregate_aggfinalfn 5 +#define Anum_pg_aggregate_aggcombinefn 6 +#define Anum_pg_aggregate_aggserialfn 7 +#define Anum_pg_aggregate_aggdeserialfn 8 +#define Anum_pg_aggregate_aggmtransfn 9 +#define Anum_pg_aggregate_aggminvtransfn 10 +#define Anum_pg_aggregate_aggmfinalfn 11 +#define Anum_pg_aggregate_aggfinalextra 12 +#define Anum_pg_aggregate_aggmfinalextra 13 +#define Anum_pg_aggregate_aggsortop 14 +#define Anum_pg_aggregate_aggtranstype 15 +#define Anum_pg_aggregate_aggtransspace 16 +#define Anum_pg_aggregate_aggmtranstype 17 +#define Anum_pg_aggregate_aggmtransspace 18 +#define Anum_pg_aggregate_agginitval 19 +#define Anum_pg_aggregate_aggminitval 20 /* * Symbolic values for aggkind column. We distinguish normal aggregates @@ -156,184 +135,185 @@ typedef FormData_pg_aggregate *Form_pg_aggregate; */ /* avg */ -DATA(insert ( 2100 n 0 int8_avg_accum numeric_poly_collect numeric_poly_avg int8_avg_combine int8_avg_serialize int8_avg_deserialize int8_avg_accum int8_avg_accum_inv numeric_poly_avg f f 0 7019 7019 128 7019 128 _null_ _null_ _null_ )); -DATA(insert ( 2101 n 0 int4_avg_accum int8_avg_collect int8_avg int4_avg_combine - - int4_avg_accum int4_avg_accum_inv int8_avg f f 0 1016 1016 0 1016 0 "{0,0}" "{0,0}" "{0,0}" )); -DATA(insert ( 2102 n 0 int2_avg_accum int8_avg_collect int8_avg int4_avg_combine - - int2_avg_accum int2_avg_accum_inv int8_avg f f 0 1016 1016 0 1016 0 "{0,0}" "{0,0}" "{0,0}" )); -DATA(insert ( 2103 n 0 numeric_avg_accum numeric_collect numeric_avg numeric_avg_combine numeric_avg_serialize numeric_avg_deserialize numeric_avg_accum numeric_accum_inv numeric_avg f f 0 7018 7018 128 7018 128 _null_ _null_ _null_ )); -DATA(insert ( 2104 n 0 float4_accum float8_collect float8_avg float8_combine - - - - - f f 0 1022 1022 0 0 0 "{0,0,0}" "{0,0,0}" _null_ )); -DATA(insert ( 2105 n 0 float8_accum float8_collect float8_avg float8_combine - - - - - f f 0 1022 1022 0 0 0 "{0,0,0}" "{0,0,0}" _null_ )); -DATA(insert ( 2106 n 0 interval_accum interval_collect interval_avg interval_combine - - interval_accum interval_accum_inv interval_avg f f 0 1187 1187 0 1187 0 "{0 second,0 second}" "{0 second,0 second}" "{0 second,0 second}" )); +DATA(insert ( 2100 n 0 int8_avg_accum numeric_poly_avg int8_avg_combine int8_avg_serialize int8_avg_deserialize int8_avg_accum int8_avg_accum_inv numeric_poly_avg f f 0 2281 48 2281 48 _null_ _null_ )); +DATA(insert ( 2101 n 0 int4_avg_accum int8_avg int4_avg_combine - - int4_avg_accum int4_avg_accum_inv int8_avg f f 0 1016 0 1016 0 "{0,0}" "{0,0}" )); +DATA(insert ( 2102 n 0 int2_avg_accum int8_avg int4_avg_combine - - int2_avg_accum int2_avg_accum_inv int8_avg f f 0 1016 0 1016 0 "{0,0}" "{0,0}" )); +DATA(insert ( 2103 n 0 numeric_avg_accum numeric_avg numeric_avg_combine numeric_avg_serialize numeric_avg_deserialize numeric_avg_accum numeric_accum_inv numeric_avg f f 0 2281 128 2281 128 _null_ _null_ )); +DATA(insert ( 2104 n 0 float4_accum float8_avg float8_combine - - - - - f f 0 1022 0 0 0 "{0,0,0}" _null_ )); +DATA(insert ( 2105 n 0 float8_accum float8_avg float8_combine - - - - - f f 0 1022 0 0 0 "{0,0,0}" _null_ )); +DATA(insert ( 2106 n 0 interval_accum interval_avg interval_combine - - interval_accum interval_accum_inv interval_avg f f 0 1187 0 1187 0 "{0 second,0 second}" "{0 second,0 second}" )); /* sum */ -DATA(insert ( 2107 n 0 int8_avg_accum numeric_poly_collect numeric_poly_sum int8_avg_combine int8_avg_serialize int8_avg_deserialize int8_avg_accum int8_avg_accum_inv numeric_poly_sum f f 0 7019 7019 128 7019 128 _null_ _null_ _null_ )); -DATA(insert ( 2108 n 0 int4_sum int8_sum_to_int8 - int8pl - - int4_avg_accum int4_avg_accum_inv int2int4_sum f f 0 20 20 0 1016 0 _null_ _null_ "{0,0}" )); -DATA(insert ( 2109 n 0 int2_sum int8_sum_to_int8 - int8pl - - int2_avg_accum int2_avg_accum_inv int2int4_sum f f 0 20 20 0 1016 0 _null_ _null_ "{0,0}" )); -DATA(insert ( 2110 n 0 float4pl float4pl - float4pl - - - - - f f 0 700 700 0 0 0 _null_ _null_ _null_ )); -DATA(insert ( 2111 n 0 float8pl float8pl - float8pl - - - - - f f 0 701 701 0 0 0 _null_ _null_ _null_ )); -DATA(insert ( 2112 n 0 cash_pl cash_pl - cash_pl - - cash_pl cash_mi - f f 0 790 790 0 790 0 _null_ _null_ _null_ )); -DATA(insert ( 2113 n 0 interval_pl interval_pl - interval_pl - - interval_pl interval_mi - f f 0 1186 1186 0 1186 0 _null_ _null_ _null_ )); -DATA(insert ( 2114 n 0 numeric_avg_accum numeric_collect numeric_sum numeric_avg_combine numeric_avg_serialize numeric_avg_deserialize numeric_avg_accum numeric_accum_inv numeric_sum f f 0 7018 7018 128 7018 128 _null_ _null_ _null_ )); +DATA(insert ( 2107 n 0 int8_avg_accum numeric_poly_sum int8_avg_combine int8_avg_serialize int8_avg_deserialize int8_avg_accum int8_avg_accum_inv numeric_poly_sum f f 0 2281 48 2281 48 _null_ _null_ )); +DATA(insert ( 2108 n 0 int4_sum - int8pl - - int4_avg_accum int4_avg_accum_inv int2int4_sum f f 0 20 0 1016 0 _null_ "{0,0}" )); +DATA(insert ( 2109 n 0 int2_sum - int8pl - - int2_avg_accum int2_avg_accum_inv int2int4_sum f f 0 20 0 1016 0 _null_ "{0,0}" )); +DATA(insert ( 2110 n 0 float4pl - float4pl - - - - - f f 0 700 0 0 0 _null_ _null_ )); +DATA(insert ( 2111 n 0 float8pl - float8pl - - - - - f f 0 701 0 0 0 _null_ _null_ )); +DATA(insert ( 2112 n 0 cash_pl - cash_pl - - cash_pl cash_mi - f f 0 790 0 790 0 _null_ _null_ )); +DATA(insert ( 2113 n 0 interval_pl - interval_pl - - interval_pl interval_mi - f f 0 1186 0 1186 0 _null_ _null_ )); +DATA(insert ( 2114 n 0 numeric_avg_accum numeric_sum numeric_avg_combine numeric_avg_serialize numeric_avg_deserialize numeric_avg_accum numeric_accum_inv numeric_sum f f 0 2281 128 2281 128 _null_ _null_ )); /* max */ -DATA(insert ( 2115 n 0 int8larger int8larger - int8larger - - - - - f f 413 20 20 0 0 0 _null_ _null_ _null_ )); -DATA(insert ( 2116 n 0 int4larger int4larger - int4larger - - - - - f f 521 23 23 0 0 0 _null_ _null_ _null_ )); -DATA(insert ( 2117 n 0 int2larger int2larger - int2larger - - - - - f f 520 21 21 0 0 0 _null_ _null_ _null_ )); -DATA(insert ( 2118 n 0 oidlarger oidlarger - oidlarger - - - - - f f 610 26 26 0 0 0 _null_ _null_ _null_ )); -DATA(insert ( 2119 n 0 float4larger float4larger - float4larger - - - - - f f 623 700 700 0 0 0 _null_ _null_ _null_ )); -DATA(insert ( 2120 n 0 float8larger float8larger - float8larger - - - - - f f 674 701 701 0 0 0 _null_ _null_ _null_ )); -DATA(insert ( 2121 n 0 int4larger int4larger - int4larger - - - - - f f 563 702 702 0 0 0 _null_ _null_ _null_ )); -DATA(insert ( 2122 n 0 date_larger date_larger - date_larger - - - - - f f 1097 1082 1082 0 0 0 _null_ _null_ _null_ )); -DATA(insert ( 2123 n 0 time_larger time_larger - time_larger - - - - - f f 1112 1083 1083 0 0 0 _null_ _null_ _null_ )); -DATA(insert ( 2124 n 0 timetz_larger timetz_larger - timetz_larger - - - - - f f 1554 1266 1266 0 0 0 _null_ _null_ _null_ )); -DATA(insert ( 2125 n 0 cashlarger cashlarger - cashlarger - - - - - f f 903 790 790 0 0 0 _null_ _null_ _null_ )); -DATA(insert ( 2126 n 0 timestamp_larger timestamp_larger timestamp_larger - - - - - - f f 2064 1114 1114 0 0 0 _null_ _null_ _null_ )); -DATA(insert ( 2127 n 0 timestamptz_larger timestamptz_larger timestamptz_larger - - - - - - f f 1324 1184 1184 0 0 0 _null_ _null_ _null_ )); -DATA(insert ( 2128 n 0 interval_larger interval_larger - interval_larger - - - - - f f 1334 1186 1186 0 0 0 _null_ _null_ _null_ )); -DATA(insert ( 2129 n 0 text_larger text_larger - text_larger - - - - - f f 666 25 25 0 0 0 _null_ _null_ _null_ )); -DATA(insert ( 2130 n 0 numeric_larger numeric_larger - numeric_larger - - - - - f f 1756 1700 1700 0 0 0 _null_ _null_ _null_ )); -DATA(insert ( 2050 n 0 array_larger array_larger - array_larger - - - - - f f 1073 2277 2277 0 0 0 _null_ _null_ _null_ )); -DATA(insert ( 2244 n 0 bpchar_larger bpchar_larger - bpchar_larger - - - - - f f 1060 1042 1042 0 0 0 _null_ _null_ _null_ )); -DATA(insert ( 2797 n 0 tidlarger tidlarger - tidlarger - - - - - f f 2800 27 27 0 0 0 _null_ _null_ _null_ )); -DATA(insert ( 3526 n 0 enum_larger enum_larger - enum_larger - - - - - f f 3519 3500 3500 0 0 0 _null_ _null_ _null_ )); -DATA(insert ( 3564 n 0 network_larger network_larger - network_larger - - - - - f f 1205 869 869 0 0 0 _null_ _null_ _null_ )); +DATA(insert ( 2115 n 0 int8larger - int8larger - - - - - f f 413 20 0 0 0 _null_ _null_ )); +DATA(insert ( 2116 n 0 int4larger - int4larger - - - - - f f 521 23 0 0 0 _null_ _null_ )); +DATA(insert ( 2117 n 0 int2larger - int2larger - - - - - f f 520 21 0 0 0 _null_ _null_ )); +DATA(insert ( 2118 n 0 oidlarger - oidlarger - - - - - f f 610 26 0 0 0 _null_ _null_ )); +DATA(insert ( 2119 n 0 float4larger - float4larger - - - - - f f 623 700 0 0 0 _null_ _null_ )); +DATA(insert ( 2120 n 0 float8larger - float8larger - - - - - f f 674 701 0 0 0 _null_ _null_ )); +DATA(insert ( 2121 n 0 int4larger - int4larger - - - - - f f 563 702 0 0 0 _null_ _null_ )); +DATA(insert ( 2122 n 0 date_larger - date_larger - - - - - f f 1097 1082 0 0 0 _null_ _null_ )); +DATA(insert ( 2123 n 0 time_larger - time_larger - - - - - f f 1112 1083 0 0 0 _null_ _null_ )); +DATA(insert ( 2124 n 0 timetz_larger - timetz_larger - - - - - f f 1554 1266 0 0 0 _null_ _null_ )); +DATA(insert ( 2125 n 0 cashlarger - cashlarger - - - - - f f 903 790 0 0 0 _null_ _null_ )); +DATA(insert ( 2126 n 0 timestamp_larger - timestamp_larger - - - - - f f 2064 1114 0 0 0 _null_ _null_ )); +DATA(insert ( 2127 n 0 timestamptz_larger - timestamptz_larger - - - - - f f 1324 1184 0 0 0 _null_ _null_ )); +DATA(insert ( 2128 n 0 interval_larger - interval_larger - - - - - f f 1334 1186 0 0 0 _null_ _null_ )); +DATA(insert ( 2129 n 0 text_larger - text_larger - - - - - f f 666 25 0 0 0 _null_ _null_ )); +DATA(insert ( 2130 n 0 numeric_larger - numeric_larger - - - - - f f 1756 1700 0 0 0 _null_ _null_ )); +DATA(insert ( 2050 n 0 array_larger - array_larger - - - - - f f 1073 2277 0 0 0 _null_ _null_ )); +DATA(insert ( 2244 n 0 bpchar_larger - bpchar_larger - - - - - f f 1060 1042 0 0 0 _null_ _null_ )); +DATA(insert ( 2797 n 0 tidlarger - tidlarger - - - - - f f 2800 27 0 0 0 _null_ _null_ )); +DATA(insert ( 3526 n 0 enum_larger - enum_larger - - - - - f f 3519 3500 0 0 0 _null_ _null_ )); +DATA(insert ( 3564 n 0 network_larger - network_larger - - - - - f f 1205 869 0 0 0 _null_ _null_ )); /* min */ -DATA(insert ( 2131 n 0 int8smaller int8smaller - int8smaller - - - - - f f 412 20 20 0 0 0 _null_ _null_ _null_ )); -DATA(insert ( 2132 n 0 int4smaller int4smaller - int4smaller - - - - - f f 97 23 23 0 0 0 _null_ _null_ _null_ )); -DATA(insert ( 2133 n 0 int2smaller int2smaller - int2smaller - - - - - f f 95 21 21 0 0 0 _null_ _null_ _null_ )); -DATA(insert ( 2134 n 0 oidsmaller oidsmaller - oidsmaller - - - - - f f 609 26 26 0 0 0 _null_ _null_ _null_ )); -DATA(insert ( 2135 n 0 float4smaller float4smaller - float4smaller - - - - - f f 622 700 700 0 0 0 _null_ _null_ _null_ )); -DATA(insert ( 2136 n 0 float8smaller float8smaller - float8smaller - - - - - f f 672 701 701 0 0 0 _null_ _null_ _null_ )); -DATA(insert ( 2137 n 0 int4smaller int4smaller - int4smaller - - - - - f f 562 702 702 0 0 0 _null_ _null_ _null_ )); -DATA(insert ( 2138 n 0 date_smaller date_smaller - date_smaller - - - - - f f 1095 1082 1082 0 0 0 _null_ _null_ _null_ )); -DATA(insert ( 2139 n 0 time_smaller time_smaller - time_smaller - - - - - f f 1110 1083 1083 0 0 0 _null_ _null_ _null_ )); -DATA(insert ( 2140 n 0 timetz_smaller timetz_smaller - timetz_smaller - - - - - f f 1552 1266 1266 0 0 0 _null_ _null_ _null_ )); -DATA(insert ( 2141 n 0 cashsmaller cashsmaller - cashsmaller - - - - - f f 902 790 790 0 0 0 _null_ _null_ _null_ )); -DATA(insert ( 2142 n 0 timestamp_smaller timestamp_smaller - timestamp_smaller - - - - - f f 2062 1114 1114 0 0 0 _null_ _null_ _null_ )); -DATA(insert ( 2143 n 0 timestamptz_smaller timestamptz_smaller - timestamptz_smaller - - - - - f f 1322 1184 1184 0 0 0 _null_ _null_ _null_ )); -DATA(insert ( 2144 n 0 interval_smaller interval_smaller - interval_smaller - - - - - f f 1332 1186 1186 0 0 0 _null_ _null_ _null_ )); -DATA(insert ( 2145 n 0 text_smaller text_smaller - text_smaller - - - - - f f 664 25 25 0 0 0 _null_ _null_ _null_ )); -DATA(insert ( 2146 n 0 numeric_smaller numeric_smaller - text_smaller - - - - - f f 1754 1700 1700 0 0 0 _null_ _null_ _null_ )); -DATA(insert ( 2051 n 0 array_smaller array_smaller - array_smaller - - - - - f f 1072 2277 2277 0 0 0 _null_ _null_ _null_ )); -DATA(insert ( 2245 n 0 bpchar_smaller bpchar_smaller - array_smaller - - - - - f f 1058 1042 1042 0 0 0 _null_ _null_ _null_ )); -DATA(insert ( 2798 n 0 tidsmaller tidsmaller - array_smaller - - - - - f f 2799 27 27 0 0 0 _null_ _null_ _null_ )); -DATA(insert ( 3527 n 0 enum_smaller enum_smaller - enum_smaller - - - - - f f 3518 3500 3500 0 0 0 _null_ _null_ _null_ )); -DATA(insert ( 3565 n 0 network_smaller network_smaller - network_smaller - - - - - f f 1203 869 869 0 0 0 _null_ _null_ _null_ )); +DATA(insert ( 2131 n 0 int8smaller - int8smaller - - - - - f f 412 20 0 0 0 _null_ _null_ )); +DATA(insert ( 2132 n 0 int4smaller - int4smaller - - - - - f f 97 23 0 0 0 _null_ _null_ )); +DATA(insert ( 2133 n 0 int2smaller - int2smaller - - - - - f f 95 21 0 0 0 _null_ _null_ )); +DATA(insert ( 2134 n 0 oidsmaller - oidsmaller - - - - - f f 609 26 0 0 0 _null_ _null_ )); +DATA(insert ( 2135 n 0 float4smaller - float4smaller - - - - - f f 622 700 0 0 0 _null_ _null_ )); +DATA(insert ( 2136 n 0 float8smaller - float8smaller - - - - - f f 672 701 0 0 0 _null_ _null_ )); +DATA(insert ( 2137 n 0 int4smaller - int4smaller - - - - - f f 562 702 0 0 0 _null_ _null_ )); +DATA(insert ( 2138 n 0 date_smaller - date_smaller - - - - - f f 1095 1082 0 0 0 _null_ _null_ )); +DATA(insert ( 2139 n 0 time_smaller - time_smaller - - - - - f f 1110 1083 0 0 0 _null_ _null_ )); +DATA(insert ( 2140 n 0 timetz_smaller - timetz_smaller - - - - - f f 1552 1266 0 0 0 _null_ _null_ )); +DATA(insert ( 2141 n 0 cashsmaller - cashsmaller - - - - - f f 902 790 0 0 0 _null_ _null_ )); +DATA(insert ( 2142 n 0 timestamp_smaller - timestamp_smaller - - - - - f f 2062 1114 0 0 0 _null_ _null_ )); +DATA(insert ( 2143 n 0 timestamptz_smaller - timestamptz_smaller - - - - - f f 1322 1184 0 0 0 _null_ _null_ )); +DATA(insert ( 2144 n 0 interval_smaller - interval_smaller - - - - - f f 1332 1186 0 0 0 _null_ _null_ )); +DATA(insert ( 2145 n 0 text_smaller - text_smaller - - - - - f f 664 25 0 0 0 _null_ _null_ )); +DATA(insert ( 2146 n 0 numeric_smaller - numeric_smaller - - - - - f f 1754 1700 0 0 0 _null_ _null_ )); +DATA(insert ( 2051 n 0 array_smaller - array_smaller - - - - - f f 1072 2277 0 0 0 _null_ _null_ )); +DATA(insert ( 2245 n 0 bpchar_smaller - bpchar_smaller - - - - - f f 1058 1042 0 0 0 _null_ _null_ )); +DATA(insert ( 2798 n 0 tidsmaller - tidsmaller - - - - - f f 2799 27 0 0 0 _null_ _null_ )); +DATA(insert ( 3527 n 0 enum_smaller - enum_smaller - - - - - f f 3518 3500 0 0 0 _null_ _null_ )); +DATA(insert ( 3565 n 0 network_smaller - network_smaller - - - - - f f 1203 869 0 0 0 _null_ _null_ )); /* count */ -DATA(insert ( 2147 n 0 int8inc_any int8_sum_to_int8 - int8pl - - int8inc_any int8dec_any - f f 0 20 20 0 20 0 "0" _null_ "0" )); -DATA(insert ( 2803 n 0 int8inc int8_sum_to_int8 - int8pl - - int8inc int8dec - f f 0 20 20 0 20 0 "0" _null_ "0" )); +DATA(insert ( 2147 n 0 int8inc_any - int8pl - - int8inc_any int8dec_any - f f 0 20 0 20 0 "0" "0" )); +DATA(insert ( 2803 n 0 int8inc - int8pl - - int8inc int8dec - f f 0 20 0 20 0 "0" "0" )); /* var_pop */ -DATA(insert ( 2718 n 0 int8_accum numeric_collect numeric_var_pop numeric_combine numeric_serialize numeric_deserialize int8_accum int8_accum_inv numeric_var_pop f f 0 7018 7018 128 7018 128 _null_ _null_ _null_ )); -DATA(insert ( 2719 n 0 int4_accum numeric_poly_collect numeric_poly_var_pop numeric_poly_combine numeric_poly_serialize numeric_poly_deserialize int4_accum int4_accum_inv numeric_poly_var_pop f f 0 7019 7019 128 7019 128 _null_ _null_ _null_ )); -DATA(insert ( 2720 n 0 int2_accum numeric_poly_collect numeric_poly_var_pop numeric_poly_combine numeric_poly_serialize numeric_poly_deserialize int2_accum int2_accum_inv numeric_poly_var_pop f f 0 7019 7019 128 7019 128 _null_ _null_ _null_ )); -DATA(insert ( 2721 n 0 float4_accum float8_collect float8_var_pop float8_combine - - - - - f f 0 1022 1022 0 0 0 "{0,0,0}" "{0,0,0}" _null_ )); -DATA(insert ( 2722 n 0 float8_accum float8_collect float8_var_pop float8_combine - - - - - f f 0 1022 1022 0 0 0 "{0,0,0}" "{0,0,0}" _null_ )); -DATA(insert ( 2723 n 0 numeric_accum numeric_collect numeric_var_pop numeric_combine numeric_serialize numeric_deserialize numeric_accum numeric_accum_inv numeric_var_pop f f 0 7018 7018 128 7018 128 _null_ _null_ _null_ )); +DATA(insert ( 2718 n 0 int8_accum numeric_var_pop numeric_combine numeric_serialize numeric_deserialize int8_accum int8_accum_inv numeric_var_pop f f 0 2281 128 2281 128 _null_ _null_ )); +DATA(insert ( 2719 n 0 int4_accum numeric_poly_var_pop numeric_poly_combine numeric_poly_serialize numeric_poly_deserialize int4_accum int4_accum_inv numeric_poly_var_pop f f 0 2281 48 2281 48 _null_ _null_ )); +DATA(insert ( 2720 n 0 int2_accum numeric_poly_var_pop numeric_poly_combine numeric_poly_serialize numeric_poly_deserialize int2_accum int2_accum_inv numeric_poly_var_pop f f 0 2281 48 2281 48 _null_ _null_ )); +DATA(insert ( 2721 n 0 float4_accum float8_var_pop float8_combine - - - - - f f 0 1022 0 0 0 "{0,0,0}" _null_ )); +DATA(insert ( 2722 n 0 float8_accum float8_var_pop float8_combine - - - - - f f 0 1022 0 0 0 "{0,0,0}" _null_ )); +DATA(insert ( 2723 n 0 numeric_accum numeric_var_pop numeric_combine numeric_serialize numeric_deserialize numeric_accum numeric_accum_inv numeric_var_pop f f 0 2281 128 2281 128 _null_ _null_ )); /* var_samp */ -DATA(insert ( 2641 n 0 int8_accum numeric_collect numeric_var_samp numeric_combine numeric_serialize numeric_deserialize int8_accum int8_accum_inv numeric_var_samp f f 0 7018 7018 128 7018 128 _null_ _null_ _null_ )); -DATA(insert ( 2642 n 0 int4_accum numeric_poly_collect numeric_poly_var_samp numeric_poly_combine numeric_poly_serialize numeric_poly_deserialize int4_accum int4_accum_inv numeric_poly_var_samp f f 0 7019 7019 128 7019 128 _null_ _null_ _null_ )); -DATA(insert ( 2643 n 0 int2_accum numeric_poly_collect numeric_poly_var_samp numeric_poly_combine numeric_poly_serialize numeric_poly_deserialize int2_accum int2_accum_inv numeric_poly_var_samp f f 0 7019 7019 128 7019 128 _null_ _null_ _null_ )); -DATA(insert ( 2644 n 0 float4_accum float8_collect float8_var_samp float8_combine - - - - - f f 0 1022 1022 0 0 0 "{0,0,0}" "{0,0,0}" _null_ )); -DATA(insert ( 2645 n 0 float8_accum float8_collect float8_var_samp float8_combine - - - - - f f 0 1022 1022 0 0 0 "{0,0,0}" "{0,0,0}" _null_ )); -DATA(insert ( 2646 n 0 numeric_accum numeric_collect numeric_var_samp numeric_combine numeric_serialize numeric_deserialize numeric_accum numeric_accum_inv numeric_var_samp f f 0 7018 7018 128 7018 128 _null_ _null_ _null_ )); +DATA(insert ( 2641 n 0 int8_accum numeric_var_samp numeric_combine numeric_serialize numeric_deserialize int8_accum int8_accum_inv numeric_var_samp f f 0 2281 128 2281 128 _null_ _null_ )); +DATA(insert ( 2642 n 0 int4_accum numeric_poly_var_samp numeric_poly_combine numeric_poly_serialize numeric_poly_deserialize int4_accum int4_accum_inv numeric_poly_var_samp f f 0 2281 48 2281 48 _null_ _null_ )); +DATA(insert ( 2643 n 0 int2_accum numeric_poly_var_samp numeric_poly_combine numeric_poly_serialize numeric_poly_deserialize int2_accum int2_accum_inv numeric_poly_var_samp f f 0 2281 48 2281 48 _null_ _null_ )); +DATA(insert ( 2644 n 0 float4_accum float8_var_samp float8_combine - - - - - f f 0 1022 0 0 0 "{0,0,0}" _null_ )); +DATA(insert ( 2645 n 0 float8_accum float8_var_samp float8_combine - - - - - f f 0 1022 0 0 0 "{0,0,0}" _null_ )); +DATA(insert ( 2646 n 0 numeric_accum numeric_var_samp numeric_combine numeric_serialize numeric_deserialize numeric_accum numeric_accum_inv numeric_var_samp f f 0 2281 128 2281 128 _null_ _null_ )); /* variance: historical Postgres syntax for var_samp */ -DATA(insert ( 2148 n 0 int8_accum numeric_collect numeric_var_samp numeric_combine numeric_serialize numeric_deserialize int8_accum int8_accum_inv numeric_var_samp f f 0 7018 7018 128 7018 128 _null_ _null_ _null_ )); -DATA(insert ( 2149 n 0 int4_accum numeric_poly_collect numeric_poly_var_samp numeric_poly_combine numeric_poly_serialize numeric_poly_deserialize int4_accum int4_accum_inv numeric_poly_var_samp f f 0 7019 7019 128 7019 128 _null_ _null_ _null_ )); -DATA(insert ( 2150 n 0 int2_accum numeric_poly_collect numeric_poly_var_samp numeric_poly_combine numeric_poly_serialize numeric_poly_deserialize int2_accum int2_accum_inv numeric_poly_var_samp f f 0 7019 7019 128 7019 128 _null_ _null_ _null_ )); -DATA(insert ( 2151 n 0 float4_accum float8_collect float8_var_samp float8_combine - - - - - f f 0 1022 1022 0 0 0 "{0,0,0}" "{0,0,0}" _null_ )); -DATA(insert ( 2152 n 0 float8_accum float8_collect float8_var_samp float8_combine - - - - - f f 0 1022 1022 0 0 0 "{0,0,0}" "{0,0,0}" _null_ )); -DATA(insert ( 2153 n 0 numeric_accum numeric_collect numeric_var_samp numeric_combine numeric_serialize numeric_deserialize numeric_accum numeric_accum_inv numeric_var_samp f f 0 7018 7018 128 7018 128 _null_ _null_ _null_ )); +DATA(insert ( 2148 n 0 int8_accum numeric_var_samp numeric_combine numeric_serialize numeric_deserialize int8_accum int8_accum_inv numeric_var_samp f f 0 2281 128 2281 128 _null_ _null_ )); +DATA(insert ( 2149 n 0 int4_accum numeric_poly_var_samp numeric_poly_combine numeric_poly_serialize numeric_poly_deserialize int4_accum int4_accum_inv numeric_poly_var_samp f f 0 2281 48 2281 48 _null_ _null_ )); +DATA(insert ( 2150 n 0 int2_accum numeric_poly_var_samp numeric_poly_combine numeric_poly_serialize numeric_poly_deserialize int2_accum int2_accum_inv numeric_poly_var_samp f f 0 2281 48 2281 48 _null_ _null_ )); +DATA(insert ( 2151 n 0 float4_accum float8_var_samp float8_combine - - - - - f f 0 1022 0 0 0 "{0,0,0}" _null_ )); +DATA(insert ( 2152 n 0 float8_accum float8_var_samp float8_combine - - - - - f f 0 1022 0 0 0 "{0,0,0}" _null_ )); +DATA(insert ( 2153 n 0 numeric_accum numeric_var_samp numeric_combine numeric_serialize numeric_deserialize numeric_accum numeric_accum_inv numeric_var_samp f f 0 2281 128 2281 128 _null_ _null_ )); /* stddev_pop */ -DATA(insert ( 2724 n 0 int8_accum numeric_collect numeric_stddev_pop numeric_combine numeric_serialize numeric_deserialize int8_accum int8_accum_inv numeric_stddev_pop f f 0 7018 7018 128 7018 128 _null_ _null_ _null_ )); -DATA(insert ( 2725 n 0 int4_accum numeric_poly_collect numeric_poly_stddev_pop numeric_poly_combine numeric_poly_serialize numeric_poly_deserialize int4_accum int4_accum_inv numeric_poly_stddev_pop f f 0 7019 7019 128 7019 128 _null_ _null_ _null_ )); -DATA(insert ( 2726 n 0 int2_accum numeric_poly_collect numeric_poly_stddev_pop numeric_poly_combine numeric_poly_serialize numeric_poly_deserialize int2_accum int2_accum_inv numeric_poly_stddev_pop f f 0 7019 7019 128 7019 128 _null_ _null_ _null_ )); -DATA(insert ( 2727 n 0 float4_accum float8_collect float8_stddev_pop float8_combine - - - - - f f 0 1022 1022 0 0 0 "{0,0,0}" "{0,0,0}" _null_ )); -DATA(insert ( 2728 n 0 float8_accum float8_collect float8_stddev_pop float8_combine - - - - - f f 0 1022 1022 0 0 0 "{0,0,0}" "{0,0,0}" _null_ )); -DATA(insert ( 2729 n 0 numeric_accum numeric_collect numeric_stddev_pop numeric_combine numeric_serialize numeric_deserialize numeric_accum numeric_accum_inv numeric_stddev_pop f f 0 7018 7018 128 7018 128 _null_ _null_ _null_ )); +DATA(insert ( 2724 n 0 int8_accum numeric_stddev_pop numeric_combine numeric_serialize numeric_deserialize int8_accum int8_accum_inv numeric_stddev_pop f f 0 2281 128 2281 128 _null_ _null_ )); +DATA(insert ( 2725 n 0 int4_accum numeric_poly_stddev_pop numeric_poly_combine numeric_poly_serialize numeric_poly_deserialize int4_accum int4_accum_inv numeric_poly_stddev_pop f f 0 2281 48 2281 48 _null_ _null_ )); +DATA(insert ( 2726 n 0 int2_accum numeric_poly_stddev_pop numeric_poly_combine numeric_poly_serialize numeric_poly_deserialize int2_accum int2_accum_inv numeric_poly_stddev_pop f f 0 2281 48 2281 48 _null_ _null_ )); +DATA(insert ( 2727 n 0 float4_accum float8_stddev_pop float8_combine - - - - - f f 0 1022 0 0 0 "{0,0,0}" _null_ )); +DATA(insert ( 2728 n 0 float8_accum float8_stddev_pop float8_combine - - - - - f f 0 1022 0 0 0 "{0,0,0}" _null_ )); +DATA(insert ( 2729 n 0 numeric_accum numeric_stddev_pop numeric_combine numeric_serialize numeric_deserialize numeric_accum numeric_accum_inv numeric_stddev_pop f f 0 2281 128 2281 128 _null_ _null_ )); /* stddev_samp */ -DATA(insert ( 2712 n 0 int8_accum numeric_collect numeric_stddev_samp numeric_combine numeric_serialize numeric_deserialize int8_accum int8_accum_inv numeric_stddev_samp f f 0 7018 7018 128 7018 128 _null_ _null_ _null_ )); -DATA(insert ( 2713 n 0 int4_accum numeric_poly_collect numeric_poly_stddev_samp numeric_poly_combine numeric_poly_serialize numeric_poly_deserialize int4_accum int4_accum_inv numeric_poly_stddev_samp f f 0 7019 7019 128 7019 128 _null_ _null_ _null_ )); -DATA(insert ( 2714 n 0 int2_accum numeric_poly_collect numeric_poly_stddev_samp numeric_poly_combine numeric_poly_serialize numeric_poly_deserialize int2_accum int2_accum_inv numeric_poly_stddev_samp f f 0 7019 7019 128 7019 128 _null_ _null_ _null_ )); -DATA(insert ( 2715 n 0 float4_accum float8_collect float8_stddev_samp float8_combine - - - - - f f 0 1022 1022 0 0 0 "{0,0,0}" "{0,0,0}" _null_ )); -DATA(insert ( 2716 n 0 float8_accum float8_collect float8_stddev_samp float8_combine - - - - - f f 0 1022 1022 0 0 0 "{0,0,0}" "{0,0,0}" _null_ )); -DATA(insert ( 2717 n 0 numeric_accum numeric_collect numeric_stddev_samp numeric_combine numeric_serialize numeric_deserialize numeric_accum numeric_accum_inv numeric_stddev_samp f f 0 7018 7018 128 7018 128 _null_ _null_ _null_ )); +DATA(insert ( 2712 n 0 int8_accum numeric_stddev_samp numeric_combine numeric_serialize numeric_deserialize int8_accum int8_accum_inv numeric_stddev_samp f f 0 2281 128 2281 128 _null_ _null_ )); +DATA(insert ( 2713 n 0 int4_accum numeric_poly_stddev_samp numeric_poly_combine numeric_poly_serialize numeric_poly_deserialize int4_accum int4_accum_inv numeric_poly_stddev_samp f f 0 2281 48 2281 48 _null_ _null_ )); +DATA(insert ( 2714 n 0 int2_accum numeric_poly_stddev_samp numeric_poly_combine numeric_poly_serialize numeric_poly_deserialize int2_accum int2_accum_inv numeric_poly_stddev_samp f f 0 2281 48 2281 48 _null_ _null_ )); +DATA(insert ( 2715 n 0 float4_accum float8_stddev_samp float8_combine - - - - - f f 0 1022 0 0 0 "{0,0,0}" _null_ )); +DATA(insert ( 2716 n 0 float8_accum float8_stddev_samp float8_combine - - - - - f f 0 1022 0 0 0 "{0,0,0}" _null_ )); +DATA(insert ( 2717 n 0 numeric_accum numeric_stddev_samp numeric_combine numeric_serialize numeric_deserialize numeric_accum numeric_accum_inv numeric_stddev_samp f f 0 2281 128 2281 128 _null_ _null_ )); /* stddev: historical Postgres syntax for stddev_samp */ -DATA(insert ( 2154 n 0 int8_accum numeric_collect numeric_stddev_samp numeric_combine numeric_serialize numeric_deserialize int8_accum int8_accum_inv numeric_stddev_samp f f 0 7018 7018 128 7018 128 _null_ _null_ _null_ )); -DATA(insert ( 2155 n 0 int4_accum numeric_poly_collect numeric_poly_stddev_sampnumeric_poly_combine numeric_poly_serialize numeric_poly_deserialize int4_accum int4_accum_inv numeric_poly_stddev_samp f f 0 7019 7019 128 7019 128 _null_ _null_ _null_ )); -DATA(insert ( 2156 n 0 int2_accum numeric_poly_collect numeric_poly_stddev_samp numeric_poly_combine numeric_poly_serialize numeric_poly_deserialize int2_accum int2_accum_inv numeric_poly_stddev_samp f f 0 7019 7019 128 7019 128 _null_ _null_ _null_ )); -DATA(insert ( 2157 n 0 float4_accum float8_collect float8_stddev_samp float8_combine - - - - - f f 0 1022 1022 0 0 0 "{0,0,0}" "{0,0,0}" _null_ )); -DATA(insert ( 2158 n 0 float8_accum float8_collect float8_stddev_samp float8_combine - - - - - f f 0 1022 1022 0 0 0 "{0,0,0}" "{0,0,0}" _null_ )); -DATA(insert ( 2159 n 0 numeric_accum numeric_collect numeric_stddev_samp numeric_combine numeric_serialize numeric_deserialize numeric_accum numeric_accum_inv numeric_stddev_samp f f 0 7018 7018 128 7018 128 _null_ _null_ _null_ )); +DATA(insert ( 2154 n 0 int8_accum numeric_stddev_samp numeric_combine numeric_serialize numeric_deserialize int8_accum int8_accum_inv numeric_stddev_samp f f 0 2281 128 2281 128 _null_ _null_ )); +DATA(insert ( 2155 n 0 int4_accum numeric_poly_stddev_samp numeric_poly_combine numeric_poly_serialize numeric_poly_deserialize int4_accum int4_accum_inv numeric_poly_stddev_samp f f 0 2281 48 2281 48 _null_ _null_ )); +DATA(insert ( 2156 n 0 int2_accum numeric_poly_stddev_samp numeric_poly_combine numeric_poly_serialize numeric_poly_deserialize int2_accum int2_accum_inv numeric_poly_stddev_samp f f 0 2281 48 2281 48 _null_ _null_ )); +DATA(insert ( 2157 n 0 float4_accum float8_stddev_samp float8_combine - - - - - f f 0 1022 0 0 0 "{0,0,0}" _null_ )); +DATA(insert ( 2158 n 0 float8_accum float8_stddev_samp float8_combine - - - - - f f 0 1022 0 0 0 "{0,0,0}" _null_ )); +DATA(insert ( 2159 n 0 numeric_accum numeric_stddev_samp numeric_combine numeric_serialize numeric_deserialize numeric_accum numeric_accum_inv numeric_stddev_samp f f 0 2281 128 2281 128 _null_ _null_ )); /* SQL2003 binary regression aggregates */ -DATA(insert ( 2818 n 0 int8inc_float8_float8 int8_sum_to_int8 int8pl - - - - - - f f 0 20 20 0 0 0 "0" _null_ _null_ )); -DATA(insert ( 2819 n 0 float8_regr_accum float8_regr_collect float8_regr_sxx float8_regr_combine - - - - - f f 0 1022 1022 0 0 0 "{0,0,0,0,0,0}" "{0,0,0,0,0,0}" _null_ )); -DATA(insert ( 2820 n 0 float8_regr_accum float8_regr_collect float8_regr_syy float8_regr_combine - - - - - f f 0 1022 1022 0 0 0 "{0,0,0,0,0,0}" "{0,0,0,0,0,0}" _null_ )); -DATA(insert ( 2821 n 0 float8_regr_accum float8_regr_collect float8_regr_sxy float8_regr_combine - - - - - f f 0 1022 1022 0 0 0 "{0,0,0,0,0,0}" "{0,0,0,0,0,0}" _null_ )); -DATA(insert ( 2822 n 0 float8_regr_accum float8_regr_collect float8_regr_avgx float8_regr_combine - - - - - f f 0 1022 1022 0 0 0 "{0,0,0,0,0,0}" "{0,0,0,0,0,0}" _null_ )); -DATA(insert ( 2823 n 0 float8_regr_accum float8_regr_collect float8_regr_avgy float8_regr_combine - - - - - f f 0 1022 1022 0 0 0 "{0,0,0,0,0,0}" "{0,0,0,0,0,0}" _null_ )); -DATA(insert ( 2824 n 0 float8_regr_accum float8_regr_collect float8_regr_r2 float8_regr_combine - - - - - f f 0 1022 1022 0 0 0 "{0,0,0,0,0,0}" "{0,0,0,0,0,0}" _null_ )); -DATA(insert ( 2825 n 0 float8_regr_accum float8_regr_collect float8_regr_slope float8_regr_combine - - - - - f f 0 1022 1022 0 0 0 "{0,0,0,0,0,0}" "{0,0,0,0,0,0}" _null_ )); -DATA(insert ( 2826 n 0 float8_regr_accum float8_regr_collect float8_regr_intercept float8_regr_combine - - - - - f f 0 1022 1022 0 0 0 "{0,0,0,0,0,0}" "{0,0,0,0,0,0}" _null_ )); -DATA(insert ( 2827 n 0 float8_regr_accum float8_regr_collect float8_covar_pop float8_regr_combine - - - - - f f 0 1022 1022 0 0 0 "{0,0,0,0,0,0}" "{0,0,0,0,0,0}" _null_ )); -DATA(insert ( 2828 n 0 float8_regr_accum float8_regr_collect float8_covar_samp float8_regr_combine - - - - - f f 0 1022 1022 0 0 0 "{0,0,0,0,0,0}" "{0,0,0,0,0,0}" _null_ )); -DATA(insert ( 2829 n 0 float8_regr_accum float8_regr_collect float8_corr float8_regr_combine - - - - - f f 0 1022 1022 0 0 0 "{0,0,0,0,0,0}" "{0,0,0,0,0,0}" _null_ )); +DATA(insert ( 2818 n 0 int8inc_float8_float8 - int8pl - - - - - f f 0 20 0 0 0 "0" _null_ )); +DATA(insert ( 2819 n 0 float8_regr_accum float8_regr_sxx float8_regr_combine - - - - - f f 0 1022 0 0 0 "{0,0,0,0,0,0}" _null_ )); +DATA(insert ( 2820 n 0 float8_regr_accum float8_regr_syy float8_regr_combine - - - - - f f 0 1022 0 0 0 "{0,0,0,0,0,0}" _null_ )); +DATA(insert ( 2821 n 0 float8_regr_accum float8_regr_sxy float8_regr_combine - - - - - f f 0 1022 0 0 0 "{0,0,0,0,0,0}" _null_ )); +DATA(insert ( 2822 n 0 float8_regr_accum float8_regr_avgx float8_regr_combine - - - - - f f 0 1022 0 0 0 "{0,0,0,0,0,0}" _null_ )); +DATA(insert ( 2823 n 0 float8_regr_accum float8_regr_avgy float8_regr_combine - - - - - f f 0 1022 0 0 0 "{0,0,0,0,0,0}" _null_ )); +DATA(insert ( 2824 n 0 float8_regr_accum float8_regr_r2 float8_regr_combine - - - - - f f 0 1022 0 0 0 "{0,0,0,0,0,0}" _null_ )); +DATA(insert ( 2825 n 0 float8_regr_accum float8_regr_slope float8_regr_combine - - - - - f f 0 1022 0 0 0 "{0,0,0,0,0,0}" _null_ )); +DATA(insert ( 2826 n 0 float8_regr_accum float8_regr_intercept float8_regr_combine - - - - - f f 0 1022 0 0 0 "{0,0,0,0,0,0}" _null_ )); +DATA(insert ( 2827 n 0 float8_regr_accum float8_covar_pop float8_regr_combine - - - - - f f 0 1022 0 0 0 "{0,0,0,0,0,0}" _null_ )); +DATA(insert ( 2828 n 0 float8_regr_accum float8_covar_samp float8_regr_combine - - - - - f f 0 1022 0 0 0 "{0,0,0,0,0,0}" _null_ )); +DATA(insert ( 2829 n 0 float8_regr_accum float8_corr float8_regr_combine - - - - - f f 0 1022 0 0 0 "{0,0,0,0,0,0}" _null_ )); /* boolean-and and boolean-or */ -DATA(insert ( 2517 n 0 booland_statefunc booland_statefunc - booland_statefunc - - bool_accum bool_accum_inv bool_alltrue f f 58 16 16 0 2281 16 _null_ _null_ _null_ )); -DATA(insert ( 2518 n 0 boolor_statefunc boolor_statefunc - boolor_statefunc - - bool_accum bool_accum_inv bool_anytrue f f 59 16 16 0 2281 16 _null_ _null_ _null_ )); -DATA(insert ( 2519 n 0 booland_statefunc booland_statefunc - booland_statefunc - - bool_accum bool_accum_inv bool_alltrue f f 58 16 16 0 2281 16 _null_ _null_ _null_ )); +DATA(insert ( 2517 n 0 booland_statefunc - booland_statefunc - - bool_accum bool_accum_inv bool_alltrue f f 58 16 0 2281 16 _null_ _null_ )); +DATA(insert ( 2518 n 0 boolor_statefunc - boolor_statefunc - - bool_accum bool_accum_inv bool_anytrue f f 59 16 0 2281 16 _null_ _null_ )); +DATA(insert ( 2519 n 0 booland_statefunc - booland_statefunc - - bool_accum bool_accum_inv bool_alltrue f f 58 16 0 2281 16 _null_ _null_ )); /* bitwise integer */ -DATA(insert ( 2236 n 0 int2and int2and - int2and - - - - - f f 0 21 21 0 0 0 _null_ _null_ _null_ )); -DATA(insert ( 2237 n 0 int2or int2or - int2or - - - - - f f 0 21 21 0 0 0 _null_ _null_ _null_ )); -DATA(insert ( 2238 n 0 int4and int4and - int4and - - - - - f f 0 23 23 0 0 0 _null_ _null_ _null_ )); -DATA(insert ( 2239 n 0 int4or int4or - int4or - - - - - f f 0 23 23 0 0 0 _null_ _null_ _null_ )); -DATA(insert ( 2240 n 0 int8and int8and - int8and - - - - - f f 0 20 20 0 0 0 _null_ _null_ _null_ )); -DATA(insert ( 2241 n 0 int8or int8or - int8or - - - - - f f 0 20 20 0 0 0 _null_ _null_ _null_ )); -DATA(insert ( 2242 n 0 bitand bitand - bitand - - - - - f f 0 1560 1560 0 0 0 _null_ _null_ _null_ )); -DATA(insert ( 2243 n 0 bitor bitor - bitor - - - - - f f 0 1560 1560 0 0 0 _null_ _null_ _null_ )); +DATA(insert ( 2236 n 0 int2and - int2and - - - - - f f 0 21 0 0 0 _null_ _null_ )); +DATA(insert ( 2237 n 0 int2or - int2or - - - - - f f 0 21 0 0 0 _null_ _null_ )); +DATA(insert ( 2238 n 0 int4and - int4and - - - - - f f 0 23 0 0 0 _null_ _null_ )); +DATA(insert ( 2239 n 0 int4or - int4or - - - - - f f 0 23 0 0 0 _null_ _null_ )); +DATA(insert ( 2240 n 0 int8and - int8and - - - - - f f 0 20 0 0 0 _null_ _null_ )); +DATA(insert ( 2241 n 0 int8or - int8or - - - - - f f 0 20 0 0 0 _null_ _null_ )); +DATA(insert ( 2242 n 0 bitand - bitand - - - - - f f 0 1560 0 0 0 _null_ _null_ )); +DATA(insert ( 2243 n 0 bitor - bitor - - - - - f f 0 1560 0 0 0 _null_ _null_ )); /* xml */ -DATA(insert ( 2901 n 0 xmlconcat2 - - - - - - - - f f 0 142 0 0 0 0 _null_ _null_ _null_ )); +DATA(insert ( 2901 n 0 xmlconcat2 - - - - - - - f f 0 142 0 0 0 _null_ _null_ )); /* array */ -DATA(insert ( 2335 n 0 array_agg_transfn - array_agg_finalfn - - - - - - t f 0 2281 0 0 0 0 _null_ _null_ _null_ )); -DATA(insert ( 4053 n 0 array_agg_array_transfn - array_agg_array_finalfn - - - - - - t f 0 2281 0 0 0 0 _null_ _null_ _null_ )); +DATA(insert ( 2335 n 0 array_agg_transfn array_agg_finalfn - - - - - - t f 0 2281 0 0 0 _null_ _null_ )); +DATA(insert ( 4053 n 0 array_agg_array_transfn array_agg_array_finalfn - - - - - - t f 0 2281 0 0 0 _null_ _null_ )); /* text */ -DATA(insert ( 3538 n 0 string_agg_transfn - string_agg_finalfn - - - - - - - - - f f 0 2281 0 0 0 0 _null_ _null_ _null_ )); +DATA(insert ( 3538 n 0 string_agg_transfn string_agg_finalfn - - - - - - f f 0 2281 0 0 0 _null_ _null_ )); /* bytea */ -DATA(insert ( 3545 n 0 bytea_string_agg_transfn - bytea_string_agg_finalfn - - - - - - - - - f f 0 2281 0 0 0 0 _null_ _null_ _null_ )); +DATA(insert ( 3545 n 0 bytea_string_agg_transfn bytea_string_agg_finalfn - - - - - - f f 0 2281 0 0 0 _null_ _null_ )); /* json */ -DATA(insert ( 3175 n 0 json_agg_transfn json_agg_collectfn json_agg_finalfn - - - - - - - - - f f 0 7028 7028 0 0 0 _null_ _null_ _null_ )); -DATA(insert ( 3197 n 0 json_object_agg_transfn - json_object_agg_finalfn - - - - - - - - - f f 0 2281 0 0 0 0 _null_ _null_ _null_ )); +DATA(insert ( 3175 n 0 json_agg_transfn json_agg_finalfn - - - - - - f f 0 2281 0 0 0 _null_ _null_ )); +DATA(insert ( 3197 n 0 json_object_agg_transfn json_object_agg_finalfn - - - - - - f f 0 2281 0 0 0 _null_ _null_ )); /* jsonb */ -DATA(insert ( 3267 n 0 jsonb_agg_transfn - jsonb_agg_finalfn - - - - - - f f 0 2281 0 0 0 0 _null_ _null_ _null_ )); -DATA(insert ( 3270 n 0 jsonb_object_agg_transfn - jsonb_object_agg_finalfn - - - - - - f f 0 2281 0 0 0 0 _null_ _null_ _null_)); +DATA(insert ( 3267 n 0 jsonb_agg_transfn jsonb_agg_finalfn - - - - - - f f 0 2281 0 0 0 _null_ _null_ )); +DATA(insert ( 3270 n 0 jsonb_object_agg_transfn jsonb_object_agg_finalfn - - - - - - f f 0 2281 0 0 0 _null_ _null_ )); /* ordered-set and hypothetical-set aggregates */ -DATA(insert ( 3972 o 1 ordered_set_transition - percentile_disc_final - - - - - - t f 0 2281 0 0 0 0 _null_ _null_ _null_ )); -DATA(insert ( 3974 o 1 ordered_set_transition - percentile_cont_float8_final - - - - - - f f 0 2281 0 0 0 0 _null_ _null_ _null_ )); -DATA(insert ( 3976 o 1 ordered_set_transition - percentile_cont_interval_final - - - - - - f f 0 2281 0 0 0 0 _null_ _null_ _null_ )); -DATA(insert ( 3978 o 1 ordered_set_transition - percentile_disc_multi_final - - - - - - t f 0 2281 0 0 0 0 _null_ _null_ _null_ )); -DATA(insert ( 3980 o 1 ordered_set_transition - percentile_cont_float8_multi_final - - - - - - f f 0 2281 0 0 0 0 _null_ _null_ _null_ )); -DATA(insert ( 3982 o 1 ordered_set_transition - percentile_cont_interval_multi_final - - - - - - f f 0 2281 0 0 0 0 _null_ _null_ _null_ )); -DATA(insert ( 3984 o 0 ordered_set_transition - mode_final - - - - - - t f 0 2281 0 0 0 0 _null_ _null_ _null_ )); -DATA(insert ( 3986 h 1 ordered_set_transition_multi - rank_final - - - - - - t f 0 2281 0 0 0 0 _null_ _null_ _null_ )); -DATA(insert ( 3988 h 1 ordered_set_transition_multi - percent_rank_final - - - - - - t f 0 2281 0 0 0 0 _null_ _null_ _null_ )); -DATA(insert ( 3990 h 1 ordered_set_transition_multi - cume_dist_final - - - - - - t f 0 2281 0 0 0 0 _null_ _null_ _null_ )); -DATA(insert ( 3992 h 1 ordered_set_transition_multi - dense_rank_final - - - - - - t f 0 2281 0 0 0 0 _null_ _null_ _null_ )); +DATA(insert ( 3972 o 1 ordered_set_transition percentile_disc_final - - - - - - t f 0 2281 0 0 0 _null_ _null_ )); +DATA(insert ( 3974 o 1 ordered_set_transition percentile_cont_float8_final - - - - - - f f 0 2281 0 0 0 _null_ _null_ )); +DATA(insert ( 3976 o 1 ordered_set_transition percentile_cont_interval_final - - - - - - f f 0 2281 0 0 0 _null_ _null_ )); +DATA(insert ( 3978 o 1 ordered_set_transition percentile_disc_multi_final - - - - - - t f 0 2281 0 0 0 _null_ _null_ )); +DATA(insert ( 3980 o 1 ordered_set_transition percentile_cont_float8_multi_final - - - - - - f f 0 2281 0 0 0 _null_ _null_ )); +DATA(insert ( 3982 o 1 ordered_set_transition percentile_cont_interval_multi_final - - - - - - f f 0 2281 0 0 0 _null_ _null_ )); +DATA(insert ( 3984 o 0 ordered_set_transition mode_final - - - - - - t f 0 2281 0 0 0 _null_ _null_ )); +DATA(insert ( 3986 h 1 ordered_set_transition_multi rank_final - - - - - - t f 0 2281 0 0 0 _null_ _null_ )); +DATA(insert ( 3988 h 1 ordered_set_transition_multi percent_rank_final - - - - - - t f 0 2281 0 0 0 _null_ _null_ )); +DATA(insert ( 3990 h 1 ordered_set_transition_multi cume_dist_final - - - - - - t f 0 2281 0 0 0 _null_ _null_ )); +DATA(insert ( 3992 h 1 ordered_set_transition_multi dense_rank_final - - - - - - t f 0 2281 0 0 0 _null_ _null_ )); + /* * prototypes for functions in pg_aggregate.c @@ -350,9 +330,6 @@ extern ObjectAddress AggregateCreate(const char *aggName, List *parameterDefaults, Oid variadicArgType, List *aggtransfnName, -#ifdef PGXC - List *aggcollectfnName, -#endif List *aggfinalfnName, List *aggcombinefnName, List *aggserialfnName, @@ -364,16 +341,10 @@ extern ObjectAddress AggregateCreate(const char *aggName, bool mfinalfnExtraArgs, List *aggsortopName, Oid aggTransType, -#ifdef XCP - Oid aggCollectType, -#endif int32 aggTransSpace, Oid aggmTransType, int32 aggmTransSpace, const char *agginitval, -#ifdef XCP - const char *agginitcollect, -#endif const char *aggminitval, char proparallel); diff --git a/src/include/catalog/pg_proc.h b/src/include/catalog/pg_proc.h index 24140efebc..0dbd71300f 100644 --- a/src/include/catalog/pg_proc.h +++ b/src/include/catalog/pg_proc.h @@ -2553,22 +2553,6 @@ DESCR("aggregate final function"); DATA(insert OID = 3535 ( string_agg_transfn PGNSP PGUID 12 1 0 0 0 f f f f f f i s 3 0 2281 "2281 25 25" _null_ _null_ _null_ _null_ _null_ string_agg_transfn _null_ _null_ _null_ )); DESCR("aggregate transition function"); -#ifdef PGXC -DATA(insert OID = 7000 ( float8_collect PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 1022 "1022 1022" _null_ _null_ _null_ _null_ _null_ float8_collect _null_ _null_ _null_ )); -DESCR("aggregate collection function"); -DATA(insert OID = 7002 ( numeric_collect PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 7018 "7018 7018" _null_ _null_ _null_ _null_ _null_ numeric_collect _null_ _null_ _null_ )); -DESCR("aggregate collection function"); -DATA(insert OID = 7013 ( numeric_poly_collect PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 7019 "7019 7019" _null_ _null_ _null_ _null_ _null_ numeric_poly_collect _null_ _null_ _null_ )); -DESCR("aggregate poly_collection function"); -DATA(insert OID = 7003 ( interval_collect PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 1187 "1187 1187" _null_ _null_ _null_ _null_ _null_ interval_collect _null_ _null_ _null_ )); -DESCR("aggregate transition function"); -DATA(insert OID = 7004 ( int8_avg_collect PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 1016 "1016 1016" _null_ _null_ _null_ _null_ _null_ int8_avg_collect _null_ _null_ _null_ )); -DESCR("AVG(int) collection function"); -DATA(insert OID = 7005 ( int8_sum_to_int8 PGNSP PGUID 12 1 0 0 0 f f f f f f i s 2 0 20 "20 20" _null_ _null_ _null_ _null_ _null_ int8_sum_to_int8 _null_ _null_ _null_ )); -DESCR("SUM(int) collection function"); -DATA(insert OID = 7006 ( float8_regr_collect PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 1022 "1022 1022" _null_ _null_ _null_ _null_ _null_ float8_regr_collect _null_ _null_ _null_ )); -DESCR("REGR_...(double, double) collection function"); -#endif DATA(insert OID = 3536 ( string_agg_finalfn PGNSP PGUID 12 1 0 0 0 f f f f f f i s 1 0 25 "2281" _null_ _null_ _null_ _null_ _null_ string_agg_finalfn _null_ _null_ _null_ )); DESCR("aggregate final function"); DATA(insert OID = 3538 ( string_agg PGNSP PGUID 12 1 0 0 0 t f f f f f i s 2 0 25 "25 25" _null_ _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); @@ -4356,8 +4340,6 @@ DATA(insert OID = 3156 ( row_to_json PGNSP PGUID 12 1 0 0 0 f f f f t f s s DESCR("map row to json with optional pretty printing"); DATA(insert OID = 3173 ( json_agg_transfn PGNSP PGUID 12 1 0 0 0 f f f f f f s s 2 0 7028 "7028 2283" _null_ _null_ _null_ _null_ _null_ json_agg_transfn _null_ _null_ _null_ )); DESCR("json aggregate transition function"); -DATA(insert OID = 7029 ( json_agg_collectfn PGNSP PGUID 12 1 0 0 0 f f f f f f s s 2 0 7028 "7028 7028" _null_ _null_ _null_ _null_ _null_ json_agg_collectfn _null_ _null_ _null_ )); -DESCR("json aggregate collection function"); DATA(insert OID = 3174 ( json_agg_finalfn PGNSP PGUID 12 1 0 0 0 f f f f f f i s 1 0 114 "7028" _null_ _null_ _null_ _null_ _null_ json_agg_finalfn _null_ _null_ _null_ )); DESCR("json aggregate final function"); DATA(insert OID = 3175 ( json_agg PGNSP PGUID 12 1 0 0 0 t f f f f f s s 1 0 114 "2283" _null_ _null_ _null_ _null_ _null_ aggregate_dummy _null_ _null_ _null_ )); @@ -5250,27 +5232,8 @@ DATA(insert OID = 7024 ( pgxc_is_inprogress PGNSP PGUID 12 1 1 0 0 f f f f t t DESCR("is given GXID in progress?"); DATA(insert OID = 7011 ( pgxc_lock_for_backup PGNSP PGUID 12 1 0 0 0 f f f f t f v u 0 0 16 "" _null_ _null_ _null_ _null_ _null_ pgxc_lock_for_backup _null_ _null_ _null_ )); DESCR("lock the cluster for taking backup"); -DATA(insert OID = 7014 ( numeric_agg_state_in PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 7018 "2275" _null_ _null_ _null_ _null_ _null_ numeric_agg_state_in _null_ _null_ _null_ )); -DESCR("I/O"); -DATA(insert OID = 7015 ( numeric_agg_state_out PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 2275 "7018" _null_ _null_ _null_ _null_ _null_ numeric_agg_state_out _null_ _null_ _null_ )); -DESCR("I/O"); -DATA(insert OID = 7016 ( numeric_agg_state_recv PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 7018 "2281" _null_ _null_ _null_ _null_ _null_ numeric_agg_state_recv _null_ _null_ _null_ )); -DESCR("I/O"); -DATA(insert OID = 7017 ( numeric_agg_state_send PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 17 "7018" _null_ _null_ _null_ _null_ _null_ numeric_agg_state_send _null_ _null_ _null_ )); -DESCR("I/O"); -DATA(insert OID = 7020 ( numeric_poly_agg_state_in PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 7019 "2275" _null_ _null_ _null_ _null_ _null_ numeric_poly_agg_state_in _null_ _null_ _null_ )); -DESCR("I/O"); -DATA(insert OID = 7021 ( numeric_poly_agg_state_out PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 2275 "7019" _null_ _null_ _null_ _null_ _null_ numeric_poly_agg_state_out _null_ _null_ _null_ )); -DESCR("I/O"); -DATA(insert OID = 7022 ( numeric_poly_agg_state_recv PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 7019 "2281" _null_ _null_ _null_ _null_ _null_ numeric_poly_agg_state_recv _null_ _null_ _null_ )); -DESCR("I/O"); -DATA(insert OID = 7023 ( numeric_poly_agg_state_send PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 17 "7019" _null_ _null_ _null_ _null_ _null_ numeric_poly_agg_state_send _null_ _null_ _null_ )); -DESCR("I/O"); -DATA(insert OID = 7030 ( json_agg_state_in PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 7028 "2275" _null_ _null_ _null_ _null_ _null_ json_agg_state_in _null_ _null_ _null_ )); -DESCR("I/O"); -DATA(insert OID = 7025 ( json_agg_state_out PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 2275 "7028" _null_ _null_ _null_ _null_ _null_ json_agg_state_out _null_ _null_ _null_ )); -DESCR("I/O"); #endif + /* pg_upgrade support */ DATA(insert OID = 3582 ( binary_upgrade_set_next_pg_type_oid PGNSP PGUID 12 1 0 0 0 f f f f t f v r 1 0 2278 "26" _null_ _null_ _null_ _null_ _null_ binary_upgrade_set_next_pg_type_oid _null_ _null_ _null_ )); DESCR("for use by pg_upgrade"); diff --git a/src/include/parser/parse_agg.h b/src/include/parser/parse_agg.h index 20909ad43f..2c81da6c58 100644 --- a/src/include/parser/parse_agg.h +++ b/src/include/parser/parse_agg.h @@ -41,19 +41,10 @@ extern void build_aggregate_transfn_expr(Oid *agg_input_types, int agg_num_direct_inputs, bool agg_variadic, Oid agg_state_type, -#ifdef XCP - Oid agg_collect_type, -#endif Oid agg_input_collation, Oid transfn_oid, -#ifdef XCP - Oid collectfn_oid, -#endif Oid invtransfn_oid, Expr **transfnexpr, -#ifdef XCP - Expr **collectfnexpr, -#endif Expr **invtransfnexpr); extern void build_aggregate_combinefn_expr(Oid agg_state_type, diff --git a/src/include/utils/builtins.h b/src/include/utils/builtins.h index a09e03724b..fa7b940659 100644 --- a/src/include/utils/builtins.h +++ b/src/include/utils/builtins.h @@ -441,18 +441,12 @@ extern Datum setseed(PG_FUNCTION_ARGS); extern Datum float8_combine(PG_FUNCTION_ARGS); extern Datum float8_accum(PG_FUNCTION_ARGS); extern Datum float4_accum(PG_FUNCTION_ARGS); -#ifdef PGXC -extern Datum float8_collect(PG_FUNCTION_ARGS); -#endif extern Datum float8_avg(PG_FUNCTION_ARGS); extern Datum float8_var_pop(PG_FUNCTION_ARGS); extern Datum float8_var_samp(PG_FUNCTION_ARGS); extern Datum float8_stddev_pop(PG_FUNCTION_ARGS); extern Datum float8_stddev_samp(PG_FUNCTION_ARGS); extern Datum float8_regr_accum(PG_FUNCTION_ARGS); -#ifdef PGXC -extern Datum float8_regr_collect(PG_FUNCTION_ARGS); -#endif extern Datum float8_regr_combine(PG_FUNCTION_ARGS); extern Datum float8_regr_sxx(PG_FUNCTION_ARGS); extern Datum float8_regr_syy(PG_FUNCTION_ARGS); @@ -1107,10 +1101,6 @@ extern Datum numeric_accum_inv(PG_FUNCTION_ARGS); extern Datum int2_accum(PG_FUNCTION_ARGS); extern Datum int4_accum(PG_FUNCTION_ARGS); extern Datum int8_accum(PG_FUNCTION_ARGS); -#ifdef PGXC -extern Datum numeric_collect(PG_FUNCTION_ARGS); -extern Datum numeric_poly_collect(PG_FUNCTION_ARGS); -#endif extern Datum numeric_poly_combine(PG_FUNCTION_ARGS); extern Datum numeric_poly_serialize(PG_FUNCTION_ARGS); extern Datum numeric_poly_deserialize(PG_FUNCTION_ARGS); @@ -1118,9 +1108,6 @@ extern Datum int2_accum_inv(PG_FUNCTION_ARGS); extern Datum int4_accum_inv(PG_FUNCTION_ARGS); extern Datum int8_accum_inv(PG_FUNCTION_ARGS); extern Datum int8_avg_accum(PG_FUNCTION_ARGS); -#ifdef PGXC -extern Datum numeric_avg_collect(PG_FUNCTION_ARGS); -#endif extern Datum int8_avg_combine(PG_FUNCTION_ARGS); extern Datum int8_avg_serialize(PG_FUNCTION_ARGS); extern Datum int8_avg_deserialize(PG_FUNCTION_ARGS); @@ -1139,14 +1126,8 @@ extern Datum numeric_poly_stddev_samp(PG_FUNCTION_ARGS); extern Datum int2_sum(PG_FUNCTION_ARGS); extern Datum int4_sum(PG_FUNCTION_ARGS); extern Datum int8_sum(PG_FUNCTION_ARGS); -#ifdef PGXC -extern Datum int8_sum_to_int8(PG_FUNCTION_ARGS); -#endif extern Datum int2_avg_accum(PG_FUNCTION_ARGS); extern Datum int4_avg_accum(PG_FUNCTION_ARGS); -#ifdef PGXC -extern Datum int8_avg_collect(PG_FUNCTION_ARGS); -#endif extern Datum int4_avg_combine(PG_FUNCTION_ARGS); extern Datum int2_avg_accum_inv(PG_FUNCTION_ARGS); extern Datum int4_avg_accum_inv(PG_FUNCTION_ARGS); @@ -1158,17 +1139,6 @@ extern Datum hash_numeric(PG_FUNCTION_ARGS); extern Datum generate_series_numeric(PG_FUNCTION_ARGS); extern Datum generate_series_step_numeric(PG_FUNCTION_ARGS); -#ifdef PGXC -extern Datum numeric_agg_state_in(PG_FUNCTION_ARGS); -extern Datum numeric_agg_state_out(PG_FUNCTION_ARGS); -extern Datum numeric_agg_state_recv(PG_FUNCTION_ARGS); -extern Datum numeric_agg_state_send(PG_FUNCTION_ARGS); -extern Datum numeric_poly_agg_state_in(PG_FUNCTION_ARGS); -extern Datum numeric_poly_agg_state_out(PG_FUNCTION_ARGS); -extern Datum numeric_poly_agg_state_recv(PG_FUNCTION_ARGS); -extern Datum numeric_poly_agg_state_send(PG_FUNCTION_ARGS); -#endif - /* ri_triggers.c */ extern Datum RI_FKey_check_ins(PG_FUNCTION_ARGS); extern Datum RI_FKey_check_upd(PG_FUNCTION_ARGS); |