Re: Error when using array_agg with filter where clause in pg16 and pg17 - Mailing list pgsql-bugs

From David Rowley
Subject Re: Error when using array_agg with filter where clause in pg16 and pg17
Date
Msg-id CAApHDvoAToLkMqJVMLnML61u2itZRfc5At5eMd_VOxY_jer0Eg@mail.gmail.com
Whole thread Raw
In response to Re: Error when using array_agg with filter where clause in pg16 and pg17  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
On Wed, 9 Apr 2025 at 12:52, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> David Rowley <dgrowleyml@gmail.com> writes:
> > I suspect we should just leave this for v18 and maybe come back and
> > improve for v19.
>
> I think not doing anything is unacceptable: even though it took awhile
> to notice, presorted_agg flat out breaks some queries that worked
> before.  That trumps any worries about "maybe the plan will be worse",
> and I don't even think it's a close decision.  So my inclination is
> to do the simplest possible thing in v16-v18, and that seems to be
> to disable presorted_agg if there's a FILTER.  Then we can look
> into better ideas at leisure for v19.

Misunderstanding. I meant do nothing about the costing issue. I still
think we should fix the bug, of course. The POC patch I posted is for
that part.

David



pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: Error when using array_agg with filter where clause in pg16 and pg17
Next
From: David Rowley
Date:
Subject: Re: Error when using array_agg with filter where clause in pg16 and pg17