Skip to content

Instantly share code, notes, and snippets.

@hotzen
Created October 10, 2022 09:42
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 hotzen/cbeff947e4197a9f57f7b20ea0457a1c to your computer and use it in GitHub Desktop.
Save hotzen/cbeff947e4197a9f57f7b20ea0457a1c to your computer and use it in GitHub Desktop.
select pid,
usename,
pg_blocking_pids(pid) as blocked_by,
query as blocked_query
from pg_stat_activity
where cardinality(pg_blocking_pids(pid)) > 0;
@hotzen
Copy link
Author

hotzen commented Oct 10, 2022

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