model-writtenrun 4887 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Alexey Makhmutov reported a PostgreSQL 15 regression where a window-function query that worked on PostgreSQL 14 failed with “WindowFunc not found in subplan target lists,” and supplied a reproducer in #1.
- Richard Guo reproduced the problem and supplied an inline fix to update WindowClause.runCondition variables during subquery pullup, matching the replacements already performed on the target list #2.
- David Rowley attached a combined fix that also preprocesses runCondition expressions so constant folding keeps their WindowFuncs consistent with the target list, while asking whether the condition representation should support qualification canonicalization #3.
- Richard Guo agreed that constant folding was necessary, explained why his simplified reproducer had missed it, and argued that the way run conditions are constructed makes canonicalization unnecessary #4.
- David Rowley committed the attached approach with light cleanup as 94985c2102, retaining the List representation and targeting backpatching through PostgreSQL 15, then confirmed that the fix had been pushed in #5.