设为首页 加入收藏

TOP

postgresql控制命令执行时长statement_timeout的操作教程
2018-03-15 08:55:07 】 浏览:138
Tags:postgresql 控制 命令 执行 时长 statement_timeout 操作 教程

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
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇MySQL中的视图使用详解 下一篇mongoDB数据库初学,NoSQL了解

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目