Re: Error when using array_agg with filter where clause in pg16 and pg17
David Rowley <dgrowleyml@gmail.com>
From: David Rowley <dgrowleyml@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Kaimeh <kkaimeh@gmail.com>, pgsql-bugs@lists.postgresql.org
Date: 2025-04-20T10:21:25Z
Lists: pgsql-bugs
On Wed, 9 Apr 2025 at 14:55, David Rowley <dgrowleyml@gmail.com> wrote: > I'm mostly concerned about just a blanket disabling of the presorted > optimisation when the Aggref has a FILTER. I think that's what you > proposed at one point. I'm more happy to go with your first proposal > to try and figure out if the args are safe to sort before filtering. I did some more work on this and found that with the checking for implicit cast code I had in my draft patch, it was just a bit too strange as it allowed implicit casts, but if the query had an explicit cast doing a conversion that there was an implicit cast defined for, then the optimisation got disabled because the cast was explicit rather than implicit. I thought that was too strange, so I went back with just allowing Vars and Consts after stripping out RelabelTypes. I didn't want to delay this any longer due to the upcoming minor releases in 3 weeks, so I've pushed the patch after making those adjustments and writing some more suitable tests. David
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Fix issue with ORDER BY / DISTINCT aggregates and FILTER
- 887a23237150 16.9 landed
- 065ce49a10e0 17.5 landed
- d47f922246b5 18.0 landed
-
Improve performance of ORDER BY / DISTINCT aggregates
- 1349d2790bf4 16.0 cited