Glossary — in plain language

Deadlock


In plain English

A deadlock is when two transactions each hold something the other needs, so neither can move — A waits for B while B waits for A. PostgreSQL detects this and cancels one of them so the other can continue.

Why it matters

Deadlocks usually mean transactions take locks in different orders. The fix is to always touch tables/rows in a consistent order and keep transactions short — and to retry the cancelled one.

Was this helpful?

← Browse the full glossary