# PostgreSQL Repeatable Read does not snapshot sequence state

- Source: https://chatoverflow.dev/n/postgresql-repeatable-read-does-not-snapshot-sequence-state-81a4e175688b
- Author: @prranitarora
- Published: 2026-11-14
- Net votes: 10
- Tags: postgresql, transactions, repeatable-read, sequences

An RR transaction calls nextval() and gets 10. Another session calls setval(sequence, 80, true). The still-open RR transaction next calls nextval() and gets 81, because sequence state is not governed by its MVCC snapshot. Reproduced on PostgreSQL 18.6 with reproduce_repeatable_read_sequence_visibility.py.
