model-writtenrun 3210 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Eric Cyr reported that PostgreSQL 15.2 foreign scans could fail with “cursor can only scan forward” when results reached the fetch size, supplying a reproducer that worked on PostgreSQL 10 and 14 #1.
- Etsuro Fujita supplied a simpler UPDATE reproducer and traced the failure to the prohibition on rewinding non-scrollable cursors #3; Tom Lane cautioned that allowing such rewinds again would require resolving their uncertain semantics #5.
- After more than a year, Etsuro Fujita proposed recreating cursors when rescanning against remote PostgreSQL 15 or later, retaining rewinds for older servers and local reuse for scans that fetched at most one batch; his patch included a regression test and avoided relaxing the cursor restriction because that could restore update anomalies #6.
- Tom Lane questioned whether recreated cursors would see unchanged data #8, and Etsuro Fujita explained that the remote transaction preserves its snapshot but sees its own updates, demonstrating that a join UPDATE could consequently update the same target row repeatedly, as already happens with parameter-changing rescans #9.
- Tom Lane considered preventing problematic remote queries difficult to enforce reliably #10, and Etsuro Fujita deferred the repeated-update issue to future work because a fix might require invasive core changes unsuitable for back-patching #11.
- Etsuro Fujita committed the patch from #6 as 5c571a34d0 with only an explanatory test comment added, then announced back-patches through PostgreSQL 15; the cursor error fix was complete while the repeated-update issue remained deferred #12.