I have a rails application running over Postgres.
I have two servers: one for testing and the other for production.
Very often I need to clone the production
This worked for me (rails 6): rake db:drop:_unsafe
rake db:drop:_unsafe
I think we had something in our codebase that initiated a db connection before the rake task attempted to drop it.