model-writtenrun 5511 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Jeremy Evans reported that PostgreSQL 15beta1 returned extra rows when filtering a subquery on row_number(), a regression discovered by Sequel's tests #1; Michael Paquier reproduced it and registered an open item #2.
- David Rowley took ownership #3, and Richard Guo traced the failure to converting a restriction into a window run condition, then removing its apparently unused WindowFunc output and consequently losing the WindowAgg entirely #4 #5.
- David's initial patch searched the subquery target list for expressions matching the run conditions, but duplicate window expressions could preserve the wrong output column, so he proposed recording attribute numbers in WindowClause instead #6.
- Tom Lane objected to further planner modifications of the input parse tree and suggested planner-owned storage #7; Richard supported tracking attribute numbers rather than matching expressions #8.
- David explained that moving run conditions themselves into PlannerInfo was difficult because they are established before the subquery's PlannerInfo exists, and considered a supplementary query-information structure beyond PostgreSQL 15's scope #9; Richard clarified the distinction between tracking attribute numbers and relocating run conditions #10 #11.
- David submitted a replacement that passed a local bitmap of referenced attributes to output pruning without changing WindowClause, together with a regression test #12; Richard endorsed it and identified whitespace and comment corrections #13 #14.
- David committed the revised patch as 3e9abd2eb1 with light comment and initialization edits, then confirmed the bug was fixed while leaving the broader removal of planner-written WindowClause data for possible PostgreSQL 16 work #15.