Last active
December 24, 2021 09:37
-
-
Save benjamin658/8bc9434b02288be0ac1e622feb957395 to your computer and use it in GitHub Desktop.
Postgres Viewing locks with table names and 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