On Sat, Mar 5, 2016 at 9:22 PM, Stephan Beal <sgbeal at googlemail.com> wrote:

> Aggregates are  _currently_ modeled as a single function which gets called
> just like normal function, but in the aggregate's "final" call the engine
> calls the aggregate function with no arguments (this is how the call knows
> it's the "final" one).
>

Follow-up, for anyone searching the archives later:

select myaggregate(*) from t;

indeed makes all calls to the aggregate without any arguments, so the
no-arguments heuristic to recognize the final call isn't useful. In my case
i'm solving it by setting a flag on the callback function instance itself
when making the final call, so that the callback can behave appropriately.

Thank you Richard and R. Smith for the confirmations!

-- 
----- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal
"Freedom is sloppy. But since tyranny's the only guaranteed byproduct of
those who insist on a perfect world, freedom will have to do." -- Bigby Wolf

Reply via email to