I\'m using Heroku with the Crane Postgres option and I was running a query on the database from my local machine when my local machine crashed. If I run
sel
We can use the following to achieve it in a single query:
SELECT pg_cancel_backend(pid), pg_terminate_backend(pid) FROM pg_stat_activity WHERE state != 'idle';