标签:pid 执行 log logs min end back highlight roc
--1.查询指定库下面的活动会话,procpid字段表示会话Proc select * from pg_stat_activity where datname = ‘dbname‘; --2.中断查询,${procpid}表示上面查询对应的procpid,下同 select pg_cancel_backend(${procpid}); --3.中断会话连接 select pg_terminate_backend(${procpid}); --4.如果需要批量终止或中断连接会话,可以写成函数或简单拼凑一下,手动执行,如: select ‘select pg_terminate_backend(‘||procpid||‘);‘,* from pg_stat_activity where datname = ‘dbname‘; select ‘select pg_cancel_backend(‘||procpid||‘);‘,* from pg_stat_activity where datname = ‘dbname‘;
标签:pid 执行 log logs min end back highlight roc
原文地址:http://www.cnblogs.com/binguo2008/p/7148217.html