Created
January 24, 2023 10:27
-
-
Save fhgbaguidi/57bf0c4f7c391e443e35742ee9d3ff4a to your computer and use it in GitHub Desktop.
Find blocking postgresql queries
This file contains 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 pid, pg_blocking_pids(pid) AS blocked_by, query AS blocked_query, backend_start | |
FROM pg_stat_activity | |
WHERE pg_blocking_pids(pid)::TEXT != '{}'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment