log_lock_waits

A GUC determining whether a log message is produced when a session waits longer than deadlock_timeout to acquire a lock

log_lock_waits is a GUC determining whether a log message is produced when a session waits longer than deadlock_timeout to acquire a lock.

log_lock_waits was added in PostgreSQL 8.3.

Default

The default value for log_lock_waits is: off.

Change history

Examples

Log message caused by TRUNCATE waiting on another transaction:

[2020-10-14 14:10:03 UTC] psql postgres postgres LOG:  00000: process 24105 still waiting for AccessExclusiveLock on relation 16451 of database 16384 after 1000.053 ms
[2020-10-14 14:10:03 UTC] psql postgres postgres DETAIL:  Process holding the lock: 17256. Wait queue: 24105.

Wait queue is a list of backend PIDs waiting to acquire a lock on the relation, ordered by time of acquisition attempt.

Categories

GUC configuration item, Locking, Logging