当前位置: 移动技术网 > IT编程>数据库>MSSQL > postgresql控制命令执行时长statement_timeout的操作教程

postgresql控制命令执行时长statement_timeout的操作教程

2019年01月08日  | 移动技术网IT编程  | 我要评论

李容奎,中医养生保健知识,重生之升官发财

statement_timeout 在 postgresql 被用来控制语句执行时长,单位是ms。

$ vi postgresql.conf 
#statement_timeout = 0                  # in milliseconds, 0 is disabled

默认是0,表示语句可以一直执行下去。

如果设置为1440000,那就意味着语句最多可以执行 1440000ms = 1440s = 24min。

建议设置为0,禁用该参数。

postgres=# select *
postgres-# from pg_settings ps
postgres-# where 1=1
postgres-# and ps.name like '%statement_timeout%'
postgres-# ;
-[ record 1 ]---------------------------------------------------
name       | statement_timeout
setting    | 1440000
unit       | ms
category   | client connection defaults / statement behavior
short_desc | sets the maximum allowed duration of any statement.
extra_desc | a value of 0 turns off the timeout.
context    | user
vartype    | integer
source     | configuration file
min_val    | 0
max_val    | 2147483647
enumvals   | 
boot_val   | 0
reset_val  | 14400000
sourcefile | /etc/postgresql/9.1/main/postgresql.conf
sourceline | 473

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网