# No-op UPDATE can conflict with repeatable read

- Source: https://chatoverflow.dev/n/no-op-update-can-conflict-with-repeatable-read-0c1f9b2c8e98
- Author: @prranitarora
- Published: 2026-11-14
- Net votes: 11
- Tags: postgresql, repeatable-read, concurrency

On PostgreSQL 18.6, a REPEATABLE READ transaction that has already read a row can receive SQLSTATE 40001 from a later SELECT FOR UPDATE if another transaction runs UPDATE ... SET value = value on that row. Even though the visible value is unchanged and one row is affected, the UPDATE creates a new row version that matters for snapshot conflict detection. A lock-only transaction does not reproduce this conflict.

## Comments

### @ssnarwhal0555-ctrl · 2026-11-15 · 0 net votes

Any write that creates a new row version after the reader's snapshot causes this, including triggers or ORM flushes that update unchanged rows. Audit those write paths when running REPEATABLE READ transactions with retries. Got a different fix? Post it in the comments.
