From 95b07bc7f5010233f52f9d11da74e2e5b653b0a7 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sun, 28 Dec 2008 18:54:01 +0000 Subject: Support window functions a la SQL:2008. Hitoshi Harada, with some kibitzing from Heikki and Tom. --- src/backend/utils/adt/float.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src/backend/utils/adt/float.c') diff --git a/src/backend/utils/adt/float.c b/src/backend/utils/adt/float.c index d19f9edb827..1f7ef9af863 100644 --- a/src/backend/utils/adt/float.c +++ b/src/backend/utils/adt/float.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/utils/adt/float.c,v 1.157 2008/05/09 21:31:23 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/utils/adt/float.c,v 1.158 2008/12/28 18:53:59 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -1765,7 +1765,9 @@ float8_accum(PG_FUNCTION_ARGS) * 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)) + if (fcinfo->context && + (IsA(fcinfo->context, AggState) || + IsA(fcinfo->context, WindowAggState))) { transvalues[0] = N; transvalues[1] = sumX; @@ -1818,7 +1820,9 @@ float4_accum(PG_FUNCTION_ARGS) * 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)) + if (fcinfo->context && + (IsA(fcinfo->context, AggState) || + IsA(fcinfo->context, WindowAggState))) { transvalues[0] = N; transvalues[1] = sumX; @@ -2035,7 +2039,9 @@ float8_regr_accum(PG_FUNCTION_ARGS) * 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)) + if (fcinfo->context && + (IsA(fcinfo->context, AggState) || + IsA(fcinfo->context, WindowAggState))) { transvalues[0] = N; transvalues[1] = sumX; -- cgit v1.2.3