Skip to content

Instantly share code, notes, and snippets.

@kubawieczorek
Created January 7, 2023 16:59
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 kubawieczorek/cb5d046a4117547c3da1587436aeb7a9 to your computer and use it in GitHub Desktop.
Save kubawieczorek/cb5d046a4117547c3da1587436aeb7a9 to your computer and use it in GitHub Desktop.
SELECT locktype, mode, query FROM pg_locks pl
LEFT JOIN pg_stat_activity psa ON pl.pid = psa.pid
JOIN pg_class pc ON pc.oid = pl.relation
WHERE pc.relname = 'employees'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment