Created
March 20, 2017 22:38
-
-
Save Sillson/27a04e282d557fba67f16ab672c27afc to your computer and use it in GitHub Desktop.
active locks
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
CREATE OR REPLACE VIEW public.active_locks AS | |
SELECT t.schemaname, | |
t.relname, | |
l.locktype, | |
l.page, | |
l.virtualtransaction, | |
l.pid, | |
l.mode, | |
l.granted | |
FROM pg_locks l | |
JOIN pg_stat_all_tables t ON l.relation = t.relid | |
WHERE t.schemaname <> 'pg_toast'::name AND t.schemaname <> 'pg_catalog'::name | |
ORDER BY t.schemaname, t.relname; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment