Re: array_agg versus repeated execution of aggregate final functions - Mailing list pgsql-hackers

From Tom Lane
Subject Re: array_agg versus repeated execution of aggregate final functions
Date
Msg-id 6922.1245520951@sss.pgh.pa.us
Whole thread Raw
In response to Re: array_agg versus repeated execution of aggregate final functions  (Merlin Moncure <mmoncure@gmail.com>)
List pgsql-hackers
Merlin Moncure <mmoncure@gmail.com> writes:
> On Sat, Jun 20, 2009 at 1:31 PM, Tom Lane<tgl@sss.pgh.pa.us> wrote:
>> There are basically two ways that we could respond to this:
>> 
>> (1) Decide that the bug is array_agg_finalfn's, and make the necessary
>> fixes so that it doesn't modify or free its argument ArrayBuildState.
>> This would amount to legislating that aggregate final functions cannot
>> scribble on their inputs *ever*, rather than the compromise position
>> we thought we had adopted last fall, namely that they can do so when
>> called by an Agg node but not when called by WindowAgg.

> This definitely sounds like the right answer.

Yeah.  On reflection, even if we tried to go with #2, we'd still need
half of the #1 fix for array_agg_finalfn --- the detoasting business is
a hazard for WindowAgg's usage anyway.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Merlin Moncure
Date:
Subject: Re: array_agg versus repeated execution of aggregate final functions
Next
From: Tom Lane
Date:
Subject: Re: 8.4 open item: copy performance regression?