postgresql 查看死锁

SELECT * FROM pg_stat_activity WHERE  wait_event_type='Lock'

查看

select * from pg_locks ;

select pid from pg_stat_activity where pid<>pg_backend_pid();