赞
踩
select distinct
'select pg_terminate_backend('||a.pid||');' as unlock_script
,c.relname
,a.pid, a.state, a.usename, a.query, a.query_start , a.client_addr
from pg_stat_activity a
,pg_locks l
,pg_class c
where a.pid = l.pid
and l.relation = c.oid
and c.relkind in ('r','p')
-- and c.relname = 'tmc_map_all_process_t'
order by c.relname
;
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。