pg 锁表

select * from pg_catalog.pg_stat_activity where usename ='gis_bd_app' and wait_event_type = 'Lock';

select * from pg_locks where relation=
(select oid from pg_class where relname='可能锁表了的表');

--取消后台操作,回滚未提交事物
select pg_cancel_backend(上面查到的pid)
--中断session,回滚未提交事物
select pg_terminate_backend(上面查到的pid)

posted @ 2022-07-07 21:01  微笑带你去  阅读(156)  评论(0编辑  收藏  举报