ERROR: could not serialize access due to concurrent update
A REPEATABLE READ/SERIALIZABLE transaction conflicted with a concurrent one and must be retried.
Seen on:
PostgreSQL
Meaning
Higher isolation levels detect conflicts instead of blocking; the application is expected to retry the whole transaction.
Common causes
- Concurrent updates to the same rows under REPEATABLE READ/SERIALIZABLE
- Hot rows (counters) updated by many transactions
⚡ Quick fix
- Retry the transaction on SQLSTATE 40001
- Reduce contention on hot rows
- Use READ COMMITTED with explicit locks if appropriate
Detailed fix by platform
PostgreSQL
- Wrap the transaction in a retry loop (3–5 attempts with small backoff)
How to diagnose
- Isolation — Which level?
- Rows — What is contended?
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
Was this page helpful?
Report a correction or suggest an improvement
Last updated 2 Oct 2026