2021
01-08
01-08
postgresql表死锁问题的排查方式
1.查询激活的执行中的sql,查看有哪些更新update的sql。select*frompg_stat_activitywherestate='active';2.查询表中存在的锁selecta.locktype,a.database,a.pid,a.mode,a.relation,b.relnamefrompg_locksajoinpg_classbona.relation=b.oidwherelower(b.relname)='h5_game';3.杀掉死锁进程selectpg_terminate_backend(pid)frompg_stat_activitywherestate='active'andpid!=pg_backend_pid()--andp...
继续阅读 >