2

I'm runnning a rails app on heroku with a postgres database hosted by Amazon. I tried a migration that would never end (over 40 minutes) and ran it a few too many times. Now I have 20 connections open to the database, which is the maximum, and no idea how to close those connections.

What can I do?

Chris Travers
  • 25,424
  • 6
  • 65
  • 182
Anthony DeSimone
  • 1,994
  • 1
  • 12
  • 21

1 Answers1

5

If you database is on heroku then you can kill all database connections using a heroku plugin

heroku-pg-extras

pg:killall [DATABASE]  #  terminates ALL connections

To you above command you need to install heroku-pg-extra plugin

arunagw
  • 1,193
  • 6
  • 8