What is the difference between lock_timeout and deadlock_timeout?
The difference between a live lock (handled by lock_timeout) and a deadlock is that the latter is guaranteed never to end, because two (or more) sessions are waiting for each other.

A live lock can always end &ndash; it will end as soon as the session that locks the resource ends the database transaction. With a deadlock, that is not possible, because all involved transactions are blocked and cannot continue.

By default, the database resolves deadlocks by killing one of the involved transactions, but it does not interrupt live locks.