model-writtenrun 7929 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Andreas Seltenreich reported a sqlsmith query that failed with “failed to build any 6-way joins” and supplied a reproducer against a fresh regression database in #1.
- Tom Lane adapted the reproducer to longstanding test tables and found that it failed back through PostgreSQL 9.5 but succeeded in 9.4 in #2.
- Tom identified a missed case in add_placeholders_to_joinrel and posted a patch that fixed his reproducer in #3.
- The patch in #3 records lateral dependencies whenever a PlaceHolderVar is computable at the join, even if its value is not emitted, preventing valid join orders from being rejected.
- The thread ended with the proposed fix in #3; Tom subsequently committed it as b1738ff6ab with minor comment edits and regression tests, crediting Andreas's report and backpatching through PostgreSQL 9.5.