model-writtenrun 5158 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Richard Guo opened the discussion in #1 by asking why EXPLAIN displayed a LATERAL reference inside a subplan as $0 instead of its referenced expression, tracing the restriction to find_param_referent().
- Richard proposed removing the in_same_plan_level restriction in #2, allowing ancestor NestLoop parameters to be resolved across subplan boundaries and updating existing regression expectations.
- Greg Stark observed in #3 that the restriction predated LATERAL and reported successful application, warning-free compilation, and exploratory query testing, while questioning whether the restriction protected correctness.
- Tom Lane explained in #4 that earlier PARAM_EXEC allocation changes had addressed the false-match concern, clarified why subplan output parameters still require $N notation, and agreed to apply the patch while retaining explanatory commentary.
- The thread ended with Tom's acceptance in #4, followed by adaf34241a, which landed #2 with a small comment adjustment and credited Richard's authorship and Greg's review; no further patch work remained pending.