Last active
April 2, 2016 20:31
-
-
Save solidsnack/91805bef4cd7f9f2b797580b472b4313 to your computer and use it in GitHub Desktop.
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 *, | |
now() - xact_start AS duration | |
FROM pg_stat_activity, | |
LATERAL (SELECT array_agg(relation::regclass) AS locks | |
FROM pg_locks JOIN pg_class ON (pg_class.oid = relation) | |
WHERE relkind = 'r' AND pg_stat_activity.pid = pg_locks.pid) | |
AS _ | |
WHERE pid != pg_backend_pid(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment