Skip to content

Instantly share code, notes, and snippets.

@isaaclw
Last active November 22, 2019 16:06
Show Gist options
  • Save isaaclw/5cd3ccdcbe6c1d175a983d4344a79980 to your computer and use it in GitHub Desktop.
Save isaaclw/5cd3ccdcbe6c1d175a983d4344a79980 to your computer and use it in GitHub Desktop.
Find PSQL Locks #psql
select pid, query_start, state, query from pg_stat_activity where pid in (
select pid from pg_locks where granted = true and relation in (
select distinct relation from pg_locks where granted = false)
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment