Created
September 22, 2022 12:40
-
-
Save source-c/b683d97ab5b32bb513278228b4e23254 to your computer and use it in GitHub Desktop.
PG show locks across all tables/queries
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 | |
relname as relation_name, | |
query, | |
pg_locks.* | |
from pg_locks | |
join pg_class on pg_locks.relation = pg_class.oid | |
join pg_stat_activity on pg_locks.pid = pg_stat_activity.pid |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment