speaking of CREATE AGGREGATE ... - Mailing list pgsql-hackers

From Chapman Flack
Subject speaking of CREATE AGGREGATE ...
Date
Msg-id 5FB5C78C.5020305@anastigmatix.net
Whole thread Raw
List pgsql-hackers
I saw in the docs for CREATE AGGREGATE, under argmode, "Aggregate functions
do not support OUT arguments".

And because I tend to poke things I'm told not to poke, I thought "but
wait, the CREATE AGGREGATE doesn't have much to say about the return type
anyway, that's just the FINALFUNC's return type." And I made an aggregate
with a finalfunc that has OUT parameters, and lo, it works, and a record
is returned with the expected aggregate results.

The only flaw seems to be that the result can't be accessed by field,
because its tupledesc isn't known. I /suspect/ (haven't chased it down
though) that the finalfunc produces a blessed tupledesc for its result,
but the identifying typmod is not propagated along to the aggregate result.

Does that sound close? Would it possibly be that simple to make such
aggregates usable? Or is there a larger can of worms I'm overlooking?

Regards,
-Chap



pgsql-hackers by date:

Previous
From: Vik Fearing
Date:
Subject: Re: CREATE AGGREGATE array_cat
Next
From: Tom Lane
Date:
Subject: Re: CREATE AGGREGATE array_cat