model-writtenrun 7330 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Melanie Plageman proposed MakeTuplestore() in #1 to eliminate repeated setup in materialized set-returning functions, initially handling descriptor creation, context switching, and ReturnSetInfo assignments together.
- Álvaro Herrera supported the cleanup but requested a more specific name, optional descriptor construction, and caller-owned ReturnSetInfo assignments in #2; Melanie implemented those choices and expanded caller coverage in #4.
- Justin Pryzby identified changed random-access behavior in #3 and explained the executor-controlled flag in #6; Melanie added a parameter in #7, then supplied conditional caller arguments in #9 after his efficiency review in #8.
- Following Justin's detailed review in #10, Melanie consolidated random-access selection inside the helper and merged the two patches in #11; Justin marked it ready in #12, and #13 corrected the remaining spacing issue.
- Justin suggested removing obsolete tuplestore_donestoring() calls in #10 and identified an invalid argument in #12; Michael endorsed removal while preserving the compatibility macro in #14, but the implementation committed as d61a361d1a came from Tatsuhito Kasahara's patch #499438 in thread #45532.
- Justin questioned when expectedDesc checks were necessary in #15, and Michael confirmed the two unsafe dereferences in #16; 07daca53bf extracted those safeguards from #13 with standardized diagnostics.
- Michael proposed deriving more tuple descriptors from existing catalog declarations and consolidating expectedDesc validation in #16, then supplied the three-part revision in #17, leaving pg_tablespace_databases() and pg_ls_dir() exceptions because of compatibility and calling-signature concerns.
- The preliminary simplifications from #17 landed as fcc28178c6, incorporating pg_options_to_table() inlining from the helper portion and improving its memory-context handling.
- The separate error-check normalization from #17 landed as e77216fcb0, adding removal of an unnecessary BRIN expectedDesc check and crediting Ranier Vilela's earlier parallel proposal in thread #45557; the latest matching patchset was posted here, and Michael reported both prerequisite commits and attached the remaining helper in #18.
- Michael substantially expanded the helper in #19 to initialize ReturnSetInfo and accept flags controlling expectedDesc use and descriptor blessing, reversing the earlier caller-owned assignment design while removing substantially more duplicated code.
- Michael renamed the expanded API SetSingleFuncCall() and documented it in #20; 9e98583898 combined that two-patch series, additionally placing descriptor allocation and blessing in the per-query context, and #21 reported successful testing and application.
- Melanie followed with eight contrib conversions in #22, leaving adminpack, tablefunc, and most dblink paths unchanged because of return-type compatibility or initialization spread across multiple helpers.
- The contrib patch landed as 5b81703787 with only a comment edit, and Michael confirmed completion in #23; all submitted work had landed, with the explicitly excluded contrib cases left for possible future work.