↑↓ 选择↵ 打开⌫ 切换范围完整搜索

PG.CENTER 连接 PostgreSQL 文档、百科与生态知识。由 Pigsty 维护。

Wiki / 配置参数

lock_timeout

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. Setting lock_timeout in postgresql.conf is not recommended because it would affect all sessions.

英文手册覆盖始于 PostgreSQL 7.4. 来源历史与运行验证各自保留独立版本边界。

当前阅读 PG 18·选择有来源记录的版本

此版本暂无所选语言的定义,以下显示原始英文内容。

boot val
0
category
Client Connection Defaults / Statement Behavior
context
user
documented
true
enumvals
未知
extra desc
0 disables the timeout.
lang
en
max val
2147483647
metadata version
18
min val
0
name
lock_timeout
short desc
Sets the maximum allowed duration of any wait for a lock.
source
pg-settings-source-snapshot
unit
ms
vartype
integer

版本定义 PG 18

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. Setting lock_timeout in postgresql.conf is not recommended because it would affect all sessions.

比较版本

来源引用

完整定义与证据 JSON

定义来源

center · PostgreSQL 18 · english-manuals:a799d789f6b2e692fa329fba690107e7393058bca3ea6e7d477ce276da6f5fe3

正文语言: en · english-manuals:a799d789f6b2e692fa329fba690107e7393058bca3ea6e7d477ce276da6f5fe3