Re: Question about using AggCheckCallContext in a C function - Mailing list pgsql-general

From Tom Lane
Subject Re: Question about using AggCheckCallContext in a C function
Date
Msg-id 23158.1376333610@sss.pgh.pa.us
Whole thread Raw
In response to Question about using AggCheckCallContext in a C function  (Matt Solnit <msolnit@soasta.com>)
Responses Re: Question about using AggCheckCallContext in a C function  (Matt Solnit <msolnit@soasta.com>)
List pgsql-general
Matt Solnit <msolnit@soasta.com> writes:
> After poring over the code in nodeAgg.c, and looking at the in8inc()
> function, I think I know what the problem is:  the typical use of
> AggCheckCallContext() is not compatible with TOAST-able data types.

That's nonsense.  There are several standard aggregates that use
that with array transition values.

Personally, I'd wonder about the blind-faith assumption in your code that
all the input arrays are exactly the same length, with no NULL elements.
At the very least a check for that would seem advisable.  An empty
(zero-dimensional) array could also make this code crash, so I'd be
inclined to put in a check that ARR_NDIM() is 1, too.

            regards, tom lane


pgsql-general by date:

Previous
From: Matt Solnit
Date:
Subject: Question about using AggCheckCallContext in a C function
Next
From: Matt Solnit
Date:
Subject: Re: Question about using AggCheckCallContext in a C function