lock_timeout
A configuration parameter determining how long a session should wait to acquire a lock
lock_timeout
is a configuration parameter determining the period of time which should elapse before an attempt to acquire a lock is abandoned.
lock_timeout
was added in PostgreSQL 9.3.
Default value
The default value for lock_timeout
is: 0
(disabled).
Usage
It is recommended to set lock_timeout
at session level, rather than globally via postgresql.conf
.
Change history
- PostgreSQL 9.3
- added (commit d43837d0)
Examples
Usage example:
postgres=# SET lock_timeout = '10s'; SET postgres=# BEGIN; BEGIN postgres=*# LOCK TABLE foo; ERROR: canceling statement due to lock timeout Time: 10001.524 ms (00:10.002)
References
- PostgreSQL documentation: lock_timeout