model-writtenrun 882 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Hang ammmkilo reported a PostgreSQL 18.3 query combining NATURAL JOIN and RIGHT JOIN that failed with “no relation entry for relid 2” in #1; Fujii Masao reproduced and bisected the regression in #2, while Kirill Reshke confirmed that disabling self-join elimination avoided it in #4.
- Tender Wang traced the failure to a clause whose Var still referenced a removed relation despite updated RestrictInfo relid sets in #5 and #6, leading Alexander Korotkov to post a provisional joininfo-rewriting workaround in #9.
- Tender identified that expression_tree_walker() skips a bare root Var in #10 and supplied a root-Var fix plus singleton-filter deduplication in #11, also exposing duplicate IS NOT NULL filters left after self-join elimination.
- Kirill Reshke endorsed Tender's patch in #12, and Alexander replaced duplicated Var handling with the existing walker in #13 while questioning whether singleton required_relids justified ignoring outer_relids.
- Andrei Lepikhov simplified the fix to a direct ChangeVarNodes_walker() call in #15, then added a regression test and proposed separating the functional fix from deduplication in #17; Alexander agreed to that split in #18.
- After Kirill questioned the test column name in #19 and Tender requested reporter credit in #20, Alexander posted the lightly revised patch in #22, which landed unchanged apart from rebasing as 07b7a964d3.
- Tom Lane objected to the walker API's inadequate documentation after the functional fix landed in #24; he then rejected a proposed Query-node assertion because callbacks may legitimately process subqueries and supplied explanatory comments in #25.
- Tender approved Tom's comment patch in #26, and it landed unchanged apart from rebasing as a0e0b3cc68.
- Alexander extended the comments to explain the bare-Var failure and the treatment of Query-level fields in #27; Tom approved with a wording correction in #28, which was incorporated into 8c73ab9da9.
- Andrei resumed the uncommitted deduplication work in #29, adding security-level protection and tests that demonstrated remaining multi-relation duplicates, while warning that ignoring RestrictInfo metadata was unsafe and suggesting a possible later deduplication stage.
- Tender agreed that the singleton shortcut was insufficient in #30, and Alexander proposed a different design in #31: compare semantic fields while combining outer_relids and incompatible_relids so the retained clause preserves both sets of placement constraints.
- Tender supported the revised design in #32, and Andrei endorsed constraint union but requested protection against newly added RestrictInfo fields and consistent treatment in update_eclasses() in #33.
- Alexander addressed that review in #34 by restoring autogenerated equality with selected fields temporarily suppressed, adding a shared constraint-merging helper and maintenance comments, and applying the comparison in update_eclasses().
- The thread ended with Tender recommending closure in #35, reporting Tom's conclusion from another discussion that the redundant filters did not need fixing; the functional fix and both documentation changes had landed, while the deduplication proposal remained uncommitted.