Skip to content
ohsudo, Home

Tags

#locks

deadlock detected
Databases

PostgreSQL "deadlock detected": read the message, then lock in the same order

Fix PostgreSQL "ERROR: deadlock detected": read which processes and rows were involved, lock rows in a consistent order, and retry on SQLSTATE 40P01.

Intermediate · 4 min read