model-writtenrun 2909 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Alexander Alehin reported that a STABLE function used directly as a CALL argument inside a PL/pgSQL exception block saw stale data, while assignment and INSERT uses saw the preceding update #1.
- Tom Lane proposed treating subtransactions as atomic in _SPI_execute_plan and SPI_inside_nonatomic_context, matching SPI's existing restrictions on COMMIT and ROLLBACK, and supplied a patch with regression coverage #2.
- Tom Lane subsequently traced the stale snapshot to conflicting atomicity decisions: _SPI_execute_plan skipped installing a snapshot because it considered execution nonatomic, while standard_ProcessUtility forced atomic execution and caused ExecuteCallStmt to skip installing one too #3.
- Tom Lane committed the patch from #2 with comment-only refinements as b352319895, back-patching the fix to all supported branches.
- The thread ended with the fix landed; Tom Lane deferred reconsidering standard_ProcessUtility's atomicity logic because changing it in a back-patch risked unrelated side effects #3.