Lock 확인
select
t.relname,l.locktype,page,virtualtransaction,pid,mode,granted
from pg_locks l, pg_stat_all_tables t
where l.relation=t.relid
order by relation asc;
Lock 풀기
-- 숫자는 Lock 확인의 pid
select pg_cancel_backend(12118); -- 먼저 해 보고
select pg_terminate_backend(20782); -- 안 되면 얘를 실행한다.
'SQL > PostgreSQL' 카테고리의 다른 글
[PostgreSQL] pgAdmin에서 Remove Server는 "서버 삭제"가 아니다! (0) | 2025.03.25 |
---|---|
[PostgreSQL] 스키마 추가, 해당 스키마 전용 유저 추가, 권한 추가 (0) | 2025.02.25 |
[postgresql] 테이블 2개 update / update 여러 개 / update 여러개 / select해서 update / 서브쿼리 update / subquery update (0) | 2021.11.17 |
[postgresql] eclipse, mybatis 사용 round does not exist (0) | 2021.11.11 |
[postgresql] uuid 생성 함수 (0) | 2021.08.26 |