postgresql - Kill all database connections on heroku when max connections have been reached -
My example has a maximum of 16 connections. As soon as I realized that I had the 19 connection, I used to hurry to kill one, who goes out to open a standard connection with the same priority and boundaries. I have now reached the absolute maximum number of connections, which is 20 , and even pg: ps or Pg: killall can not. How can I destroy all the connections, or do anything to reduce the number of connections now? The blocked query is too long (looks like select * from the table containing 410k entries). $ heroku pg: info -a XYZ === HEROKU_POSTGRESQL_COBALT_URL (DATABASE_URL) Plan: Original Status: Available Connection: 19 PG Version: 9.1.11 Created: 2013-03-12 15: 11 UTC data size: 7.16 GB Tables: 103 Fork / Follow: Unsupported rollback: unsupported $ Heroco PG: PS-A XYZ Prop. Source | Is running for Wait | (...) $ heroku pg: kill 12593- one XYZ pg_cancel_backend ------------------- T (1 line) $ heroku pg: ps -a XYZ psql: FATAL : Too many connections to role ...