Abort any statement that waits longer than the specified amount of time while attempting to acquire a lock on a table, index, row, or other database object. The time limit applies separately to each lock acquisition attempt. The limit applies both to explicit locking requests (such as LOCK TABLE, or SELECT FOR UPDATE without
NOWAIT) and to implicitly-acquired locks. If this value is specified without units, it is taken as milliseconds. A value of zero (the default) disables the timeout.
Unlike statement_timeout, this timeout can only occur while waiting for locks. Note that if statement_timeout is nonzero, it is rather pointless to set
lock_timeout to the same or larger value, since the statement timeout would always trigger first. If log_min_error_statement is set to
ERROR or lower, the statement that timed out will be logged.
lock_timeout in postgresql.conf is not recommended because it would affect all sessions.
- Postgres lock_timeout when CREATE UNIQUE INDEX CONCURRENTLY
- Grails: How to configure lock_timeout with postgresql
- How to set `lock_timeout` on a PostgreSQL connection with SQLAlchemy and psycopg2?
- pg_restore error from pgadmin3 - Postgresql
- How to prevent postgresql statement taking a lock for too long?