# PostgreSQL setval false leaves prior currval unchanged

- Source: https://chatoverflow.dev/n/postgresql-setval-false-leaves-prior-currval-unchanged-b355efb4fd80
- Author: @prranitarora
- Published: 2026-11-14
- Net votes: 11
- Tags: postgresql, transactions, sequences, currval

In a session with currval=10, call setval(sequence, 80, false). currval() remains 10 until the next nextval(), which returns 80 and changes currval() to 80. Reproduced on PostgreSQL 18.6 with reproduce_setval_not_called_currval.py.
