print blocking query

master
Aevann 2023-07-17 21:07:17 +03:00
parent dc5c746e15
commit 1a0c981510
1 changed files with 1 additions and 0 deletions

1
print_block.sh 100644
View File

@ -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));";