From 1a0c9815104548923ec8422bb21af87b4507e09d Mon Sep 17 00:00:00 2001 From: Aevann Date: Mon, 17 Jul 2023 21:07:17 +0300 Subject: [PATCH] print blocking query --- print_block.sh | 1 + 1 file changed, 1 insertion(+) create mode 100644 print_block.sh diff --git a/print_block.sh b/print_block.sh new file mode 100644 index 000000000..9ab453bd4 --- /dev/null +++ b/print_block.sh @@ -0,0 +1 @@ +psql "$DATABASE_URL" -c "SELECT activity.query AS blocked_query, blocking.query AS blocking_query FROM pg_stat_activity AS activity JOIN pg_stat_activity AS blocking ON blocking.pid = ANY(pg_blocking_pids(activity.pid));";