Skip to content

Instantly share code, notes, and snippets.

@dsalahutdinov
Created July 2, 2014 07:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dsalahutdinov/f61d3c2e34c293babc79 to your computer and use it in GitHub Desktop.
Save dsalahutdinov/f61d3c2e34c293babc79 to your computer and use it in GitHub Desktop.
watch_another_process_blocks.sql
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