Reset Rails DB on Heroku

Jelani Woods
Sep 3, 2018 · 1 min read
FATAL: permission denied for database “postgres”
DETAIL: User does not have CONNECT privilege.
Couldn’t drop database ‘d2fmm5q24q9ilu’
rails aborted!
PG::ConnectionBad: FATAL: permission denied for database “postgres”
DETAIL: User does not have CONNECT privilege.

While trying to reset my Rails database on Heroku I get the error above when running heroku run rails db:reset. I always seem to forget the solution so I’m writing it here so that I have it for future reference.

The command is heroku pg:reset DATABASE. It should be noted that since this resets the database you will need to migrate the database again before the app will function.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade