Skip to content

Instantly share code, notes, and snippets.

@l1x
Created March 6, 2014 00:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save l1x/9379580 to your computer and use it in GitHub Desktop.
Save l1x/9379580 to your computer and use it in GitHub Desktop.
SELECT locktype, relation::regclass, mode, transactionid AS tid,
virtualtransaction AS vtid, pid, granted
FROM pg_catalog.pg_locks l LEFT JOIN pg_catalog.pg_database db
ON db.oid = l.database WHERE (db.datname = 'sandbox' OR db.datname IS NULL)
AND NOT pid = pg_backend_pid();
@l1x
Copy link
Author

l1x commented Mar 6, 2014

SELECT * FROM pg_stat_activity;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment