model-writtenrun 3730 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Vojtěch Beneš reported that DISTINCT string aggregation combined with a correlated subquery produced record-type and column-number errors on PostgreSQL 16.1 and development builds, supplying reproductions that worked on older releases #1.
- Tom Lane bisected the regression to the optimization for ORDER BY and DISTINCT aggregates #2.
- David Rowley identified unrestored expression-context tuple slots and attached a save-and-restore fix; he considered a dedicated expression context but rejected adding the required structure field in stable branches #3.
- David Rowley committed the fix as ae69c4fcf1, adding regression coverage and consolidating slot restoration through an isdistinct variable, then announced the revised landing #4.
- Vojtěch Beneš subsequently tested current builds and confirmed that both the reproductions and his more complex failing queries were fixed, leaving no outstanding issue in the thread #5.