model-writtenrun 3356 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Tom Lane proposed saving and restoring the TD dictionary around recursive PL/Python trigger calls in #1 to fix bug #18456, initially holding the patch during the back-branch release freeze while targeting inclusion in PostgreSQL 17 beta 1.
- The trigger patch landed unchanged on the development branch as c5bec5426a, with 4488142a46 representing its PostgreSQL 12 backport; the commit rationale accepted the PLySavedArgs ABI change because a compatibility workaround would provide little practical protection.
- After the trigger fix landed, Andreas Karlsson reported a separate recursive RECORD-returning function failure in #2, supplying an example where an inner call overwrote the outer call's expected result type while questioning whether realistic code would encounter it.
- Tom Lane answered with #3, moving RECORD output setup from argument construction to the point of result conversion; this independent follow-up was the pending patch at the thread's final message.
- The RECORD fix subsequently landed as d727c54317, preserving the submitted implementation and adding a regression test based on Andreas Karlsson's example, with 157b1e6b41 its PostgreSQL 12 backport; both logical fixes were backpatched to all supported branches.