model-writtenrun 8047 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- David Christensen reported that FETCH FIRST ROW WITH TIES combined with FOR UPDATE SKIP LOCKED locks an unreturned row, causing another session to skip the next batch #1.
- David proposed an inline planner change placing Limit before LockRows #2, but Tom Lane questioned its correctness #3, and David withdrew the approach after recognizing that LockRows must perform the skipping #5.
- Alvaro Herrera tested the inline patch and found that the second query returned no rows; he explored executor peeking and forbidding the combination, while observing that a subquery workaround still produced locking beneath Limit #6.
- Tom argued that introducing executor nodes could be backpatched if existing NodeTag values were preserved #7, and David considered restricting any new node structure to the affected cases #8.
- David submitted a currently failing isolation test expecting the second session to receive the next batch, formalizing the desired behavior without implementing a fix #9.
- At the thread's end, David explained that checking locks without acquiring them would require additional table-access-method infrastructure and favored exploring prohibition and a workaround; the implementation remained unresolved #10.
- The later work in thread #44677 supplied the implementation committed as c6bc655ee2, which rejects SKIP LOCKED combined with WITH TIES instead of adopting this thread's isolation test or planner reordering.