查询出锁表的pid 进行中断或者取消
--取消后台操作,回滚未提交事物 select pg_cancel_backend(pid) --中断session,回滚未提交事物 select pg_terminate_backend(pid)
select 'select pg_cancel_backend(' || pid || ');' from pg_locks where relation in (select oid from pg_class where relname='锁表的表名')
根据查出来的sql 全都执行就行了
标签:中断,pid,取消,pg,select,backend From: https://www.cnblogs.com/banxia-boke/p/16712106.html