Reset Rails DB on Heroku
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.