mlw <markw(at)mohawksoft(dot)com> writes:
>> If the needed parameters are all the same datatype, maybe you could put
>> them into an array and pass the array as a single argument to the
> How would you do this without having to make multiple SQL calls?
I was thinking something like
select my_aggregate(my_array_constructor(foo, bar, baz)) from ...
where my_array_constructor is a quick hack C routine to build a
3-element array from 3 input arguments (s/3/whatever you need/).
Someday we ought to have SQL syntax to build an array value from
a list of scalars, but in the meantime an auxiliary function is the
only way to do it.
The overhead of constructing and then interpreting the temporary
array value is slightly annoying, but I don't think it'll be horribly
expensive. See the existing aggregate-related routines in numeric.c
if you need some help with the C coding.
regards, tom lane
In response to
pgsql-hackers by date
|Next:||From: Rene Pijlman||Date: 2001-08-23 19:33:35|
|Subject: Re: Toast, Text, blob bytea Huh?|
|Previous:||From: mlw||Date: 2001-08-23 19:11:04|
|Subject: Re: OLAP, Aggregates, and order of operations|