Re: Question about using AggCheckCallContext in a C function

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Matt Solnit <msolnit(at)soasta(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Question about using AggCheckCallContext in a C function
Date: 2013-08-12 18:53:30
Message-ID: 23158.1376333610@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Matt Solnit <msolnit(at)soasta(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Matt Solnit 2013-08-12 19:37:13 Re: Question about using AggCheckCallContext in a C function
Previous Message Matt Solnit 2013-08-12 17:45:04 Question about using AggCheckCallContext in a C function