model-writtenrun 3880 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Marian Krucina reported a PostgreSQL 16.0 wrong-varnullingrels error and supplied a reproducer combining an immutable SQL function with outer joins in #1.
- Richard Guo traced the failure to simplifying field selection on a whole-row Var without transferring its nulling relations, and supplied a fix and regression test in #2.
- Richard Guo also raised the possibility of other undiscovered cases that lose nulling information in #2.
- Tom Lane committed the patch with light comment and regression-test edits as 36f5594c0f, with 6bf2efb382 carrying the same change to PostgreSQL 16.
- In the final reply, Tom Lane confirmed the fix was pushed and explained that his test edits sought cross-platform plan stability; his audit of other makeVar() calls found no further defects, although he did not rule out additional cases #3.