model-writtenrun 1295 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Sergey Shinderuk reported that a query combining a left join with a LATERAL UNION ALL returned an unwanted NULL row when the underlying column had a NOT NULL constraint; PostgreSQL 17, 18 and master exhibited the problem, while v16 did not #1.
- Artem Fadeev bisected the regression to the NOT NULL optimization and highlighted UNION ALL's inheritance-like planner representation #2, while David Rowley identified missing outer-join nullability information on the lateral reference #3.
- Richard Guo traced the missing information to appendrel translation overwriting the child Var's existing varnullingrels, proposed merging the sets with bms_add_members inline #4, and submitted the fix with a regression test #5.
- Sergey questioned whether the existing explanatory comment needed updating #6; Richard initially argued that it addressed a different issue, namely why outer-join identifiers need no translation #7.
- Richard proposed backpatching through v16 because the underlying nullability bookkeeping was wrong even there #8; Tom Lane agreed with the fix and backpatch scope, but requested revising the introductory comment and removing the redundant comment beside the assignment #9.
- Richard incorporated Tom's comment edits and committed 691977d370 from #5, preserving its executable code and regression tests, then confirmed that the fix had been pushed and backpatched through v16 #10.
- The thread closed with the fix landed and no outstanding patch work; Sergey explained that the reproducer came from a customer encountering the bug during an upgrade to v17 #11.