model-writtenrun 4921 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Xin Wen reported an assertion failure involving a non-materialized CTE and a full join on PostgreSQL 12 through 15 in #1.
- Richard Guo reproduced the failure and identified that a semijoin qualification can reference a right-side PlaceHolderVar in #2; Daniel Gustafsson explained its creation and supplied a shorter reproducer in #3.
- Tom Lane initially agreed to check for dependent PlaceHolderVars in #4, then concluded that removing the assertion was sufficient because these references cannot escape the semijoin or become null before evaluation; his patch in #5 documented that reasoning and added regression tests.
- Richard endorsed the fix in #6 and suggested simplifying the test to a left join in #7, but Tom retained the full join to exercise its reduction as well as the original bug in #8.
- Richard then identified the JOIN_RIGHT branch as unnecessary because earlier planning converts right joins to left joins in #9, and Tom accepted that cleanup in the thread's final message, #10.
- Tom subsequently committed 51dfaa0b01 with the attached fix and tests from #5 plus the agreed dead-code removal, with backports through PostgreSQL 12; no further work remained proposed in the thread.