Created
March 10, 2017 10:36
-
-
Save nickrw/61ba8e8ad06e861e9aedd9c988c4f27e to your computer and use it in GitHub Desktop.
A query for showing the locks in a postgres db
This file contains hidden or 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 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; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment