Postgres "idle in transaction" Sessions Are Blocking Your Migrations and Vacuum: Find Them, Fix the Code, Set a Timeout - DEV Community
Postgres "idle in transaction" sessions hold locks and stall vacuum. How to find them, fix the app code, and set timeouts that stop it.