Toggle navigation
类型: integer
默认: 0
最低限度: 0
最大: 2147483647
单元: milliseconds (ms)
上下文: user
重新开始: false

中止任何使用了超过指定毫秒数的语句,从命令到达服务器开始计时。如果log_min_error_statement被设置为ERROR或更低,语句如果超时也会被记录。一个零值(默认)将关闭这个参数。

我们不推荐在postgresql.conf中设置statement_timeout,因为它会影响所有会话。

建议 [EN]

Defaults to 0, meaning no timeout. For most web applications, it's a good idea to set a default timeout, such as 60s to prevent runaway queries from bogging the server. If set, though, you need to remember to set (at the ROLE or session level) a higher statement_timeout for expected long-running maintenance or batch operations.

条评论