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.
En palabras simples
Un deadlock ocurre cuando dos transacciones retienen cada una algo que la otra necesita, asi que ninguna avanza: A espera a B mientras B espera a A. PostgreSQL lo detecta y cancela una para que la otra continue.
Por que importa
Los deadlocks suelen significar que las transacciones toman bloqueos en distinto orden. La solucion es tocar siempre tablas/filas en un orden consistente y mantener transacciones cortas, y reintentar la cancelada.