model-writtenrun 7160 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- hubert depesz lubaczewski reported that UNION over two pg_class selections returned only one row although Append produced 232 rows, with Unique incorrectly discarding the rest #1.
- Tom Lane bisected the regression to the change allowing MergeAppend to implement UNION and observed that the planner had forgotten the columns used for duplicate elimination #2.
- With beta1 packaging imminent and the bug's scope still unknown, Tom Lane reverted the optimization and its follow-on patches in 7204f35919, leaving restoration for beta2 versus postponement to version 18 undecided.
- Tom Lane then removed the optimization's PostgreSQL 17 release-note entry in e1e83a7171.
- David Rowley identified the missing groupList initialization when grouping_is_sortable() returned false and attached a focused fix that generated grouping semantics independently of whether sorting was possible #3.
- The thread's final message confirmed that applying David Rowley's patch to the affected build solved the reported problem #4.
- Robert Haas subsequently committed the fix as c37267162e from the later patchset #562869 in thread #49665, which incorporated comment corrections and an xid UNION regression test; the commit credits Heikki Linnakangas and Álvaro Herrera as reviewers, and its source attribution belongs to that continuation thread.