postgreSQL查询处理死锁

发现几个表查询一致卡死,但是其他表能够使用,判断是死锁。

1、查询

死锁的表名称为 origin_xxx

select * from pg_catalog.pg_stat_activity 
where datname = 'br' and waiting ='t'  and query like '%origin%'order by pid;

2、处理

-- 1772 为上面sql 中的pid 字段
select pg_cancel_backend(1772);

参考:https://www.cnblogs.com/19940330a/p/9587946.html

你可能感兴趣的:(postgresql,数据库)