model-writtenrun 214 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Junwen AN reported that INTERSECT ALL beneath UNION ALL with an empty arm failed during planning on PostgreSQL 19beta4 and development HEAD, while PostgreSQL 18.6 worked #1.
- Tom Lane bisected the regression and traced the failure to eliminating an empty child: the surviving single-child Append inherited pathkeys whose Vars could not match its varno-0 targetlist #2 #3.
- Shihao zhong submitted a small fix clearing inherited pathkeys for UNION and EXCEPT ALL Appends, with regression tests; he had abandoned an initial SetOp-pathkey repair because it changed too many plans for PostgreSQL 19 #4.
- David Rowley suggested repairing redundant-pathkey handling in child equivalence construction, while Tom favored suppressing Append pathkeys and deferred replacing the varno-0 representation because that redesign was too large for PostgreSQL 19 #5 #6.
- Tom independently posted a UNION-only fix, choosing a local prepunion.c workaround over a new create_append_path flag; Shihao supplied a failing EXCEPT ALL case, and Tom agreed that suppressing pathkeys also limited risks from ambiguous varno-0 equivalence classes #7 #8 #9.
- Shihao tested 20,000 random queries under seven planner configurations: clearing both Appends' pathkeys eliminated all 2,516 observed pathkey failures, with no wrong answers, but exposed a separate EXPLAIN failure involving a Var beneath a coercion; he attached a recursive setrefs.c fix #10.
- Tom revised that EXPLAIN fix to choose the actual leftmost represented child using Result.relids instead of always using varno 1, and Shihao confirmed successful EXPLAIN output across the same random queries and nested cases #11 #12.
- The EXPLAIN revision landed as 3e3edd1a61, preserving the code and tests from #11 with only a commit-message wording edit and crediting Shihao as author and Tom as co-author.
- The pathkey fix landed as 2509f3c6b5, extending #7 to all three prepunion.c Append creation sites and adding revised tests incorporating Shihao's EXCEPT ALL case; Tom credited Shihao as co-author and confirmed that both fixes were pushed and the open item closed #13.
- Tom proposed replacing varno-0 Vars with ordinary Vars referencing new RTE_SETOP entries, and Shihao agreed to pursue that redesign in a new hackers thread while leaving parse-time targetlist construction for a follow-up; the misleading EXPLAIN “Aggregate” replacement label remained a separate concern #11 #13 #14.