■ 잠금 프로세스를 조회하는 방법을 보여준다.
▶ 예제 코드 (SQL)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
SELECT A.DATNAME ,L.RELATION::REGCLASS ,L.TRANSACTIONID ,L.MODE ,L.GRANTED ,A.USENAME ,A.QUERY ,A.QUERY_START ,AGE(NOW(), A.QUERY_START) AS AGE ,A.PID FROM PG_STAT_ACTIVITY A JOIN PG_LOCKS L ON L.PID = A.PID ORDER BY A.QUERY_START; |