Last active
September 13, 2022 04:23
-
-
Save Megaprog/cfa1203c1d65cc1748b79cc2f73c8aa6 to your computer and use it in GitHub Desktop.
How to see PG locks with advisory bigint hash
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 l.pid, relation::regclass, mode, a.application_name, a.query_start, locktype, | |
(classid::bigint << 32) | objid::bigint as hash | |
from pg_locks l join pg_stat_activity a on l.pid = a.pid where granted; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment