Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e3TQI-0003wR-SW for pgsql-bugs@arkaria.postgresql.org; Sat, 14 Oct 2017 20:52:43 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1e3TQH-0007XX-6v for pgsql-bugs@arkaria.postgresql.org; Sat, 14 Oct 2017 20:52:41 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1e3TPX-0006Fl-Fo for pgsql-bugs@postgresql.org; Sat, 14 Oct 2017 20:51:55 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1e3TPP-0004vh-Av for pgsql-bugs@postgresql.org; Sat, 14 Oct 2017 20:51:55 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id v9EKpW9m020305; Sat, 14 Oct 2017 16:51:32 -0400 From: Tom Lane To: David Rowley cc: Lukas Eder , PostgreSQL mailing lists , Heikki Linnakangas Subject: Re: Combination of ordered-set aggregate function terminates JDBC connection on PostgreSQL 9.6.5 In-reply-to: <3802.1507775225@sss.pgh.pa.us> References: <23270.1507751492@sss.pgh.pa.us> <3802.1507775225@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Wed, 11 Oct 2017 22:27:05 -0400" MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----- =_aaaaaaaaaa0" Content-ID: <20243.1508014223.0@sss.pgh.pa.us> Date: Sat, 14 Oct 2017 16:51:32 -0400 Message-ID: <20303.1508014292@sss.pgh.pa.us> List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org ------- =_aaaaaaaaaa0 Content-Type: text/plain; charset="us-ascii" Content-ID: <20243.1508014223.1@sss.pgh.pa.us> I wrote: > To know what value of randomAccess to pass to the tuplesort setup, > we have to know *at the first transition-function call* whether > there may be multiple final-function calls coming up. So what > what I'm imagining is a simple boolean result "yes, there will be > only one finalfn call, so it can destructively modify the transition > state", or "there might be more than one finalfn call, so the finalfn(s) > must preserve transition state". And this info has to be available > throughout the aggregate run. Attached is a proposed patch to make the ordered-set aggregates safe for state merging. I've not tested it really thoroughly, but it passes the regression cases added in 52328727b. regards, tom lane ------- =_aaaaaaaaaa0 Content-Type: text/x-diff; name="allow-state-merging-in-builtin-OSAs.patch"; charset="us-ascii" Content-ID: <20243.1508014223.2@sss.pgh.pa.us> Content-Description: allow-state-merging-in-builtin-OSAs.patch Content-Transfer-Encoding: quoted-printable diff --git a/src/backend/executor/nodeAgg.c b/src/backend/executor/nodeAgg.c index 40d8ec9..1718285 100644 *** a/src/backend/executor/nodeAgg.c --- b/src/backend/executor/nodeAgg.c *************** typedef struct AggStatePerTransData *** 255,260 **** --- 255,265 ---- Aggref *aggref; =20=20 /* + * Is this state value actually being shared by more than one Aggref? + */ + bool aggshared; +=20 + /* * Nominal number of arguments for aggregate function. For plain aggs, * this excludes any ORDER BY expressions. For ordered-set aggs, this * counts both the direct and aggregated (ORDER BY) arguments. *************** ExecInitAgg(Agg *node, EState *estate, i *** 3345,3353 **** { /* * Existing compatible trans found, so just point the 'peragg' to ! * the same per-trans struct. */ pertrans =3D &pertransstates[existing_transno]; peragg->transno =3D existing_transno; } else --- 3350,3359 ---- { /* * Existing compatible trans found, so just point the 'peragg' to ! * the same per-trans struct, and mark the trans state as shared. */ pertrans =3D &pertransstates[existing_transno]; + pertrans->aggshared =3D true; peragg->transno =3D existing_transno; } else *************** build_pertrans_for_aggref(AggStatePerTra *** 3449,3454 **** --- 3455,3461 ---- =20=20 /* Begin filling in the pertrans data */ pertrans->aggref =3D aggref; + pertrans->aggshared =3D false; pertrans->aggCollation =3D aggref->inputcollid; pertrans->transfn_oid =3D aggtransfn; pertrans->serialfn_oid =3D aggserialfn; *************** AggGetAggref(FunctionCallInfo fcinfo) *** 4105,4121 **** { if (fcinfo->context && IsA(fcinfo->context, AggState)) { AggStatePerAgg curperagg; AggStatePerTrans curpertrans; =20=20 /* check curperagg (valid when in a final function) */ ! curperagg =3D ((AggState *) fcinfo->context)->curperagg; =20=20 if (curperagg) return curperagg->aggref; =20=20 /* check curpertrans (valid when in a transition function) */ ! curpertrans =3D ((AggState *) fcinfo->context)->curpertrans; =20=20 if (curpertrans) return curpertrans->aggref; --- 4112,4129 ---- { if (fcinfo->context && IsA(fcinfo->context, AggState)) { + AggState *aggstate =3D (AggState *) fcinfo->context; AggStatePerAgg curperagg; AggStatePerTrans curpertrans; =20=20 /* check curperagg (valid when in a final function) */ ! curperagg =3D aggstate->curperagg; =20=20 if (curperagg) return curperagg->aggref; =20=20 /* check curpertrans (valid when in a transition function) */ ! curpertrans =3D aggstate->curpertrans; =20=20 if (curpertrans) return curpertrans->aggref; *************** AggGetTempMemoryContext(FunctionCallInfo *** 4146,4151 **** --- 4154,4197 ---- } =20=20 /* + * AggStateIsShared - find out whether transition state is shared + * + * If the function is being called as an aggregate support function, + * return TRUE if the aggregate's transition state is shared across + * multiple aggregates, FALSE if it is not. + * + * Returns TRUE if not called as an aggregate support function. + * This is intended as a conservative answer, ie "no you'd better not + * scribble on your input". In particular, will return TRUE if the + * aggregate is being used as a window function, which is a scenario + * in which changing the transition state is a bad idea. We might + * want to refine the behavior for the window case in future. + */ + bool + AggStateIsShared(FunctionCallInfo fcinfo) + { + if (fcinfo->context && IsA(fcinfo->context, AggState)) + { + AggState *aggstate =3D (AggState *) fcinfo->context; + AggStatePerAgg curperagg; + AggStatePerTrans curpertrans; +=20 + /* check curperagg (valid when in a final function) */ + curperagg =3D aggstate->curperagg; +=20 + if (curperagg) + return aggstate->pertrans[curperagg->transno].aggshared; +=20 + /* check curpertrans (valid when in a transition function) */ + curpertrans =3D aggstate->curpertrans; +=20 + if (curpertrans) + return curpertrans->aggshared; + } + return true; + } +=20 + /* * AggRegisterCallback - register a cleanup callback for an aggregate * * This is useful for aggs to register shutdown callbacks, which will ens= ure diff --git a/src/backend/utils/adt/orderedsetaggs.c b/src/backend/utils/adt= /orderedsetaggs.c index 25905a3..1e323d9 100644 *** a/src/backend/utils/adt/orderedsetaggs.c --- b/src/backend/utils/adt/orderedsetaggs.c *************** *** 40,53 **** * create just once per query because they will not change across groups. * The per-query struct and subsidiary data live in the executor's per-qu= ery * memory context, and go away implicitly at ExecutorEnd(). */ =20=20 typedef struct OSAPerQueryState { ! /* Aggref for this aggregate: */ Aggref *aggref; /* Memory context containing this struct and other per-query data: */ MemoryContext qcontext; =20=20 /* These fields are used only when accumulating tuples: */ =20=20 --- 40,61 ---- * create just once per query because they will not change across groups. * The per-query struct and subsidiary data live in the executor's per-qu= ery * memory context, and go away implicitly at ExecutorEnd(). + * + * These structs are set up during the first call of the transition funct= ion. + * Because we allow nodeAgg.c to merge ordered-set aggregates (but not + * hypothetical aggregates) with identical inputs and transition function= s, + * this info must not depend on the particular aggregate (ie, particular + * final-function), nor on the direct argument(s) of the aggregate. */ =20=20 typedef struct OSAPerQueryState { ! /* Representative Aggref for this aggregate: */ Aggref *aggref; /* Memory context containing this struct and other per-query data: */ MemoryContext qcontext; + /* Do we expect multiple final-function calls within one group? */ + bool rescan_needed; =20=20 /* These fields are used only when accumulating tuples: */ =20=20 *************** typedef struct OSAPerGroupState *** 91,96 **** --- 99,106 ---- Tuplesortstate *sortstate; /* Number of normal rows inserted into sortstate: */ int64 number_of_rows; + /* Have we already done tuplesort_performsort? */ + bool sort_done; } OSAPerGroupState; =20=20 static void ordered_set_shutdown(Datum arg); *************** ordered_set_startup(FunctionCallInfo fci *** 146,151 **** --- 156,164 ---- qstate->aggref =3D aggref; qstate->qcontext =3D qcontext; =20=20 + /* We need to support rescans if the trans state is shared */ + qstate->rescan_needed =3D AggStateIsShared(fcinfo); +=20 /* Extract the sort information */ sortlist =3D aggref->aggorder; numSortCols =3D list_length(sortlist); *************** ordered_set_startup(FunctionCallInfo fci *** 277,291 **** qstate->sortOperators, qstate->sortCollations, qstate->sortNullsFirsts, ! work_mem, false); else osastate->sortstate =3D tuplesort_begin_datum(qstate->sortColType, qstate->sortOperator, qstate->sortCollation, qstate->sortNullsFirst, ! work_mem, false); =20=20 osastate->number_of_rows =3D 0; =20=20 /* Now register a shutdown callback to clean things up at end of group */ AggRegisterCallback(fcinfo, --- 290,307 ---- qstate->sortOperators, qstate->sortCollations, qstate->sortNullsFirsts, ! work_mem, ! qstate->rescan_needed); else osastate->sortstate =3D tuplesort_begin_datum(qstate->sortColType, qstate->sortOperator, qstate->sortCollation, qstate->sortNullsFirst, ! work_mem, ! qstate->rescan_needed); =20=20 osastate->number_of_rows =3D 0; + osastate->sort_done =3D false; =20=20 /* Now register a shutdown callback to clean things up at end of group */ AggRegisterCallback(fcinfo, *************** ordered_set_startup(FunctionCallInfo fci *** 306,319 **** * group) by ExecutorEnd. But we must take care to release any potential * non-memory resources. * ! * This callback is arguably unnecessary, since we don't support use of ! * ordered-set aggs in AGG_HASHED mode and there is currently no non-error ! * code path in non-hashed modes wherein nodeAgg.c won't call the finalfn ! * after calling the transfn one or more times. So in principle we could= rely ! * on the finalfn to delete the tuplestore etc. However, it's possible t= hat ! * such a code path might exist in future, and in any case it'd be ! * notationally tedious and sometimes require extra data copying to ensure ! * we always delete the tuplestore in the finalfn. */ static void ordered_set_shutdown(Datum arg) --- 322,333 ---- * group) by ExecutorEnd. But we must take care to release any potential * non-memory resources. * ! * In the case where we're not expecting multiple finalfn calls, we could ! * arguably rely on the finalfn to clean up; but it's easier and more tes= table ! * if we just do it the same way in either case. Note that many of the ! * finalfns could *not* free the tuplesort object, at least not without e= xtra ! * data copying, because what they return is a pointer to a datum inside = the ! * tuplesort object. */ static void ordered_set_shutdown(Datum arg) *************** percentile_disc_final(PG_FUNCTION_ARGS) *** 436,443 **** if (osastate->number_of_rows =3D=3D 0) PG_RETURN_NULL(); =20=20 ! /* Finish the sort */ ! tuplesort_performsort(osastate->sortstate); =20=20 /*---------- * We need the smallest K such that (K/N) >=3D percentile. --- 450,463 ---- if (osastate->number_of_rows =3D=3D 0) PG_RETURN_NULL(); =20=20 ! /* Finish the sort, or rescan if we already did */ ! if (!osastate->sort_done) ! { ! tuplesort_performsort(osastate->sortstate); ! osastate->sort_done =3D true; ! } ! else ! tuplesort_rescan(osastate->sortstate); =20=20 /*---------- * We need the smallest K such that (K/N) >=3D percentile. *************** percentile_disc_final(PG_FUNCTION_ARGS) *** 457,469 **** if (!tuplesort_getdatum(osastate->sortstate, true, &val, &isnull, NULL)) elog(ERROR, "missing row in percentile_disc"); =20=20 - /* - * Note: we *cannot* clean up the tuplesort object here, because the val= ue - * to be returned is allocated inside its sortcontext. We could use - * datumCopy to copy it out of there, but it doesn't seem worth the - * trouble, since the cleanup callback will clear the tuplesort later. - */ -=20 /* We shouldn't have stored any nulls, but do the right thing anyway */ if (isnull) PG_RETURN_NULL(); --- 477,482 ---- *************** percentile_cont_final_common(FunctionCal *** 543,550 **** =20=20 Assert(expect_type =3D=3D osastate->qstate->sortColType); =20=20 ! /* Finish the sort */ ! tuplesort_performsort(osastate->sortstate); =20=20 first_row =3D floor(percentile * (osastate->number_of_rows - 1)); second_row =3D ceil(percentile * (osastate->number_of_rows - 1)); --- 556,569 ---- =20=20 Assert(expect_type =3D=3D osastate->qstate->sortColType); =20=20 ! /* Finish the sort, or rescan if we already did */ ! if (!osastate->sort_done) ! { ! tuplesort_performsort(osastate->sortstate); ! osastate->sort_done =3D true; ! } ! else ! tuplesort_rescan(osastate->sortstate); =20=20 first_row =3D floor(percentile * (osastate->number_of_rows - 1)); second_row =3D ceil(percentile * (osastate->number_of_rows - 1)); *************** percentile_cont_final_common(FunctionCal *** 575,587 **** val =3D lerpfunc(first_val, second_val, proportion); } =20=20 - /* - * Note: we *cannot* clean up the tuplesort object here, because the val= ue - * to be returned may be allocated inside its sortcontext. We could use - * datumCopy to copy it out of there, but it doesn't seem worth the - * trouble, since the cleanup callback will clear the tuplesort later. - */ -=20 PG_RETURN_DATUM(val); } =20=20 --- 594,599 ---- *************** percentile_disc_multi_final(PG_FUNCTION_ *** 779,786 **** */ if (i < num_percentiles) { ! /* Finish the sort */ ! tuplesort_performsort(osastate->sortstate); =20=20 for (; i < num_percentiles; i++) { --- 791,804 ---- */ if (i < num_percentiles) { ! /* Finish the sort, or rescan if we already did */ ! if (!osastate->sort_done) ! { ! tuplesort_performsort(osastate->sortstate); ! osastate->sort_done =3D true; ! } ! else ! tuplesort_rescan(osastate->sortstate); =20=20 for (; i < num_percentiles; i++) { *************** percentile_disc_multi_final(PG_FUNCTION_ *** 804,814 **** } } =20=20 - /* - * We could clean up the tuplesort object after forming the array, but - * probably not worth the trouble. - */ -=20 /* We make the output array the same shape as the input */ PG_RETURN_POINTER(construct_md_array(result_datum, result_isnull, ARR_NDIM(param), --- 822,827 ---- *************** percentile_cont_multi_final_common(Funct *** 902,909 **** */ if (i < num_percentiles) { ! /* Finish the sort */ ! tuplesort_performsort(osastate->sortstate); =20=20 for (; i < num_percentiles; i++) { --- 915,928 ---- */ if (i < num_percentiles) { ! /* Finish the sort, or rescan if we already did */ ! if (!osastate->sort_done) ! { ! tuplesort_performsort(osastate->sortstate); ! osastate->sort_done =3D true; ! } ! else ! tuplesort_rescan(osastate->sortstate); =20=20 for (; i < num_percentiles; i++) { *************** percentile_cont_multi_final_common(Funct *** 962,972 **** } } =20=20 - /* - * We could clean up the tuplesort object after forming the array, but - * probably not worth the trouble. - */ -=20 /* We make the output array the same shape as the input */ PG_RETURN_POINTER(construct_md_array(result_datum, result_isnull, ARR_NDIM(param), --- 981,986 ---- *************** mode_final(PG_FUNCTION_ARGS) *** 1043,1050 **** =20=20 shouldfree =3D !(osastate->qstate->typByVal); =20=20 ! /* Finish the sort */ ! tuplesort_performsort(osastate->sortstate); =20=20 /* Scan tuples and count frequencies */ while (tuplesort_getdatum(osastate->sortstate, true, &val, &isnull, &abb= rev_val)) --- 1057,1070 ---- =20=20 shouldfree =3D !(osastate->qstate->typByVal); =20=20 ! /* Finish the sort, or rescan if we already did */ ! if (!osastate->sort_done) ! { ! tuplesort_performsort(osastate->sortstate); ! osastate->sort_done =3D true; ! } ! else ! tuplesort_rescan(osastate->sortstate); =20=20 /* Scan tuples and count frequencies */ while (tuplesort_getdatum(osastate->sortstate, true, &val, &isnull, &abb= rev_val)) *************** mode_final(PG_FUNCTION_ARGS) *** 1097,1109 **** if (shouldfree && !last_val_is_mode) pfree(DatumGetPointer(last_val)); =20=20 - /* - * Note: we *cannot* clean up the tuplesort object here, because the val= ue - * to be returned is allocated inside its sortcontext. We could use - * datumCopy to copy it out of there, but it doesn't seem worth the - * trouble, since the cleanup callback will clear the tuplesort later. - */ -=20 if (mode_freq) PG_RETURN_DATUM(mode_val); else --- 1117,1122 ---- *************** hypothetical_rank_common(FunctionCallInf *** 1174,1179 **** --- 1187,1195 ---- =20=20 hypothetical_check_argtypes(fcinfo, nargs, osastate->qstate->tupdesc); =20=20 + /* because we need a hypothetical row, we can't share transition state */ + Assert(!osastate->sort_done); +=20 /* insert the hypothetical row into the sort */ slot =3D osastate->qstate->tupslot; ExecClearTuple(slot); *************** hypothetical_rank_common(FunctionCallInf *** 1190,1195 **** --- 1206,1212 ---- =20=20 /* finish the sort */ tuplesort_performsort(osastate->sortstate); + osastate->sort_done =3D true; =20=20 /* iterate till we find the hypothetical row */ while (tuplesort_gettupleslot(osastate->sortstate, true, true, slot, NUL= L)) *************** hypothetical_rank_common(FunctionCallInf *** 1207,1216 **** =20=20 ExecClearTuple(slot); =20=20 - /* Might as well clean up the tuplesort object immediately */ - tuplesort_end(osastate->sortstate); - osastate->sortstate =3D NULL; -=20 return rank; } =20=20 --- 1224,1229 ---- *************** hypothetical_dense_rank_final(PG_FUNCTIO *** 1329,1334 **** --- 1342,1350 ---- /* Get short-term context we can use for execTuplesMatch */ tmpcontext =3D AggGetTempMemoryContext(fcinfo); =20=20 + /* because we need a hypothetical row, we can't share transition state */ + Assert(!osastate->sort_done); +=20 /* insert the hypothetical row into the sort */ slot =3D osastate->qstate->tupslot; ExecClearTuple(slot); *************** hypothetical_dense_rank_final(PG_FUNCTIO *** 1345,1350 **** --- 1361,1367 ---- =20=20 /* finish the sort */ tuplesort_performsort(osastate->sortstate); + osastate->sort_done =3D true; =20=20 /* * We alternate fetching into tupslot and extraslot so that we have the *************** hypothetical_dense_rank_final(PG_FUNCTIO *** 1391,1400 **** =20=20 ExecDropSingleTupleTableSlot(extraslot); =20=20 - /* Might as well clean up the tuplesort object immediately */ - tuplesort_end(osastate->sortstate); - osastate->sortstate =3D NULL; -=20 rank =3D rank - duplicate_count; =20=20 PG_RETURN_INT64(rank); --- 1408,1413 ---- diff --git a/src/include/catalog/pg_aggregate.h b/src/include/catalog/pg_ag= gregate.h index 5769f64..13f1bce 100644 *** a/src/include/catalog/pg_aggregate.h --- b/src/include/catalog/pg_aggregate.h *************** DATA(insert ( 3267 n 0 jsonb_agg_transfn *** 318,330 **** DATA(insert ( 3270 n 0 jsonb_object_agg_transfn jsonb_object_agg_finalfn = - - - - - - f f r r 0 2281 0 0 0 _null_ _null_ )); =20=20 /* ordered-set and hypothetical-set aggregates */ ! DATA(insert ( 3972 o 1 ordered_set_transition percentile_disc_final = - - - - - - t f w w 0 2281 0 0 0 _null_ _null_ )); ! DATA(insert ( 3974 o 1 ordered_set_transition percentile_cont_float8_fi= nal - - - - - - f f w w 0 2281 0 0 0 _null_ _null_ )); ! DATA(insert ( 3976 o 1 ordered_set_transition percentile_cont_interval_= final - - - - - - f f w w 0 2281 0 0 0 _null_ _null_ )); ! DATA(insert ( 3978 o 1 ordered_set_transition percentile_disc_multi_fin= al - - - - - - t f w w 0 2281 0 0 0 _null_ _null_ )); ! DATA(insert ( 3980 o 1 ordered_set_transition percentile_cont_float8_mu= lti_final - - - - - - f f w w 0 2281 0 0 0 _null_ _null_ )); ! DATA(insert ( 3982 o 1 ordered_set_transition percentile_cont_interval_= multi_final - - - - - - f f w w 0 2281 0 0 0 _null_ _null_ )); ! DATA(insert ( 3984 o 0 ordered_set_transition mode_final - - - -= - - t f w w 0 2281 0 0 0 _null_ _null_ )); DATA(insert ( 3986 h 1 ordered_set_transition_multi rank_final - -= - - - - t f w w 0 2281 0 0 0 _null_ _null_ )); DATA(insert ( 3988 h 1 ordered_set_transition_multi percent_rank_final = - - - - - - t f w w 0 2281 0 0 0 _null_ _null_ )); DATA(insert ( 3990 h 1 ordered_set_transition_multi cume_dist_final = - - - - - - t f w w 0 2281 0 0 0 _null_ _null_ )); --- 318,330 ---- DATA(insert ( 3270 n 0 jsonb_object_agg_transfn jsonb_object_agg_finalfn = - - - - - - f f r r 0 2281 0 0 0 _null_ _null_ )); =20=20 /* ordered-set and hypothetical-set aggregates */ ! DATA(insert ( 3972 o 1 ordered_set_transition percentile_disc_final = - - - - - - t f s s 0 2281 0 0 0 _null_ _null_ )); ! DATA(insert ( 3974 o 1 ordered_set_transition percentile_cont_float8_fi= nal - - - - - - f f s s 0 2281 0 0 0 _null_ _null_ )); ! DATA(insert ( 3976 o 1 ordered_set_transition percentile_cont_interval_= final - - - - - - f f s s 0 2281 0 0 0 _null_ _null_ )); ! DATA(insert ( 3978 o 1 ordered_set_transition percentile_disc_multi_fin= al - - - - - - t f s s 0 2281 0 0 0 _null_ _null_ )); ! DATA(insert ( 3980 o 1 ordered_set_transition percentile_cont_float8_mu= lti_final - - - - - - f f s s 0 2281 0 0 0 _null_ _null_ )); ! DATA(insert ( 3982 o 1 ordered_set_transition percentile_cont_interval_= multi_final - - - - - - f f s s 0 2281 0 0 0 _null_ _null_ )); ! DATA(insert ( 3984 o 0 ordered_set_transition mode_final - - - -= - - t f s s 0 2281 0 0 0 _null_ _null_ )); DATA(insert ( 3986 h 1 ordered_set_transition_multi rank_final - -= - - - - t f w w 0 2281 0 0 0 _null_ _null_ )); DATA(insert ( 3988 h 1 ordered_set_transition_multi percent_rank_final = - - - - - - t f w w 0 2281 0 0 0 _null_ _null_ )); DATA(insert ( 3990 h 1 ordered_set_transition_multi cume_dist_final = - - - - - - t f w w 0 2281 0 0 0 _null_ _null_ )); diff --git a/src/include/fmgr.h b/src/include/fmgr.h index b604a5c..a68ec91 100644 *** a/src/include/fmgr.h --- b/src/include/fmgr.h *************** extern int AggCheckCallContext(FunctionC *** 698,703 **** --- 698,704 ---- MemoryContext *aggcontext); extern fmAggrefPtr AggGetAggref(FunctionCallInfo fcinfo); extern MemoryContext AggGetTempMemoryContext(FunctionCallInfo fcinfo); + extern bool AggStateIsShared(FunctionCallInfo fcinfo); extern void AggRegisterCallback(FunctionCallInfo fcinfo, fmExprContextCallbackFunction func, Datum arg); ------- =_aaaaaaaaaa0 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs ------- =_aaaaaaaaaa0--