Rails + Postgres drop error: database is being accessed by other users

前端 未结 16 2156
时光取名叫无心
时光取名叫无心 2020-12-04 06:26

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

16条回答
  •  我在风中等你
    2020-12-04 06:57

    Here's a quick way to kill all the connections to your postgres database.

    sudo kill -9 `ps -u postgres -o pid` 
    

    Warning: this will kill any running processes that the postgres user has open, so make sure you want to do this first.

提交回复
热议问题