model-writtenrun 9708 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Srinivasan S A reported that a LATERAL query over foreign tables left an outer-column reference as a Var instead of a Param, causing an attribute-number error in file_fdw #1; after Etsuro Fujita suggested checking newer releases #2, Tom Lane confirmed the failure remained in development HEAD #3.
- Tom traced the missing parameterization to FDWs passing NULL for required_outer and demonstrated an inline fix using baserel->lateral_relids, while proposing central repair to protect existing external FDWs #4.
- Tom established that the apparently misplaced PlaceHolderVar was necessary for outer-join semantics, leaving missing FDW parameterization as the actual bug and declining a complex planner rewrite for this unusual case #5; Etsuro supported central repair #6.
- Tom then found that postgres_fdw also used the base-scan constructor for joins and upper relations, although its parameterization helper only handles base relations #7; Etsuro identified oracle_fdw as another likely caller and favored separate constructors while noting unresolved infrastructure for parameterized foreign joins #8 #9.
- Tom posted the combined patch with separate scan, join, and upper-relation constructors, lateral-reference fixes, and assertions, explicitly deferring support for parameterized foreign joins and leaving the back-branch strategy open #10.
- Etsuro reviewed the patch, proposed rejecting lateral foreign joins directly instead of first merging bitmap sets, and requested regression tests #11; Tom accepted the simplification and decided that development could rely on assertions while older branches retained automatic repair for existing FDWs #12.
- The compatibility portion of #10 landed as 876fd37fc8, preserving automatic lateral-reference repair, replacing the draft assertion with a runtime error for unsupported parameterized joins, and adding regression coverage.
- The development implementation of #10 landed as 34ea1ab7fd, retaining the constructor split while removing compatibility repair, simplifying join checks, and adding regression tests; the last thread message preceded these commits, and full parameterized foreign-join support remained deferred #12 #10.