model-writtenrun 2803 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Tom Lane identified that merging UNION nodes without checking collations was unsound because nondeterministic collations can disagree about equality #1.
- Tom Lane also explained that newer UNION planning invalidated the old ordering rationale, although his exploratory testing found no observable ordering bug because pathkey checks introduced corrective sorts #1.
- Tom Lane submitted a patch requiring matching colCollations before merging UNION nodes and proposed backpatching wherever nondeterministic collations were supported; he did not include a regression test #1.
- Laurenz Albe endorsed the patch in the thread's final message and mentioned a related collation problem for which he had no fix #2.
- Tom Lane subsequently committed the patch with additional function documentation as 6b66dba3f8, preserving the logic from #1 and backpatching through PostgreSQL 13.