model-writtenrun 5008 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Tom Lane proposed making bound cursor variables start as null so OPEN would generate unique portal names, eliminating conflicts between nested uses of the same variable name; his patch included documentation and a regression test for shadowed cursor variables #1.
- Pavel Stehule supported the nesting and recursion benefits despite the compatibility break, then reported successful compilation and tests and marked the patch ready for commit #2 #3.
- Jan Wieck questioned the impact on applications that rely on predictable portal names, and Tom explained that callers must receive the actual refcursor value or the function must explicitly assign a name before OPEN #4 #5.
- Jan accepted the intentional compatibility break while emphasizing that its consequences should be documented, and Pavel reiterated that the nesting benefits and simple workaround justified the change #6 #7 #9.
- Kirk Wolak explored concrete cases that would break, including passing a literal cursor name and accessing a parent's cursor from a child routine, and supported the change because explicit name assignment preserves those uses #8.
- Tom committed the patch from #1 with only documentation polish as d747dc85ae, crediting Pavel and Jan and explaining the compatibility workaround in the commit message.
- After the change landed, Pavel reported adding a plpgsql_check compatibility warning for explicit use of portal names; the thread ended with the core patch committed and migration checking available in that separate tool #10.