Created
July 2, 2014 07:53
-
-
Save dsalahutdinov/f61d3c2e34c293babc79 to your computer and use it in GitHub Desktop.
watch_another_process_blocks.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT a.pid, a.usename, mode, locktype, query, state, granted, | |
tuple, transactionid, classid, objid, objsubid | |
FROM pg_catalog.pg_locks bl | |
JOIN pg_catalog.pg_stat_activity a ON a.pid = bl.pid | |
where granted and a.pid <> pg_backend_pid() | |
order by locktype; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment