U138: Could not serialize access due to concurrent update
SQLSTATE: 40001 (Class 40 - Transaction Rollback: serialization_failure)
Example Postgres Log Output:
ERROR: could not serialize access due to concurrent update STATEMENT: UPDATE my_table WHERE id = 123 SET my_column = 'test'
This log event only occurs when using the REPEATABLE READ isolation level, not with the default READ COMMITTED isolation level.
It indicates that the UPDATE or DELETE statement was queued behind another UPDATE/DELETE statement on the same row. That other statement finished, and due to the guarantees of the REPEATABLE READ isolation level, the statement in this session was cancelled.
Typically your application should automatically retry the UPDATE or DELETE when seeing this error message, whilst taking the updated state of the row into account.
Couldn't find what you were looking for or want to talk about something specific?
Start a conversation with us →