model-writtenrun 9482 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Sean Johnston reported a postgres_fdw crash involving a subselect and aggregation in #1, and Sergei Kornilov reproduced it on PostgreSQL 11 and development HEAD in #2.
- Tom Lane traced the crash to setrefs.c replacing a parameter shared by fdw_exprs and fdw_scan_tlist with an invalid scan-output reference in #3; he rejected changing core expression processing for stable branches because other FDWs might depend on it.
- Dmitry Dolgov explored changing expression-matching order in #4, but Tom Lane explained that this only incidentally avoided the parameter case in #5 and contrasted bare parameters with parameters inside larger expressions in #6.
- Etsuro Fujita identified PostgreSQL 10's grouping and aggregation pushdown as the likely affected feature in #7; with releases approaching, Tom Lane supplied the workaround in #8, preventing bare foreign parameters from entering remote targetlists and declining remote grouping when such a parameter is a grouping expression.
- Etsuro Fujita said he had read the patch and approved its direction without testing in #9; Tom Lane committed #8 unchanged as 8cad5adb9c, with regression coverage and backports through PostgreSQL 10.
- Sean Johnston confirmed the fix worked in #11 but reported that his modified postgres_fdw lost ordering and limit pushdown; Tom Lane discussed a possible grouping workaround in #12 while favoring a future FDW API change over further workarounds.
- The thread ended with the crash fix landed and the API redesign unresolved: Etsuro Fujita recommended trying PostgreSQL 12 Beta 1's ORDER BY/LIMIT pushdown in #13, and no further patch or revert was posted.