Postgresql - unable to drop database because of some auto connections to DB

前端 未结 17 1823
一向
一向 2020-12-12 08:18

Whenever I try to drop database I get:

ERROR:  database \"pilot\" is being accessed by other users
DETAIL:  There is 1 other session using the database.
         


        
17条回答
  •  旧时难觅i
    2020-12-12 09:13

    In terminal try this command:

    ps -ef | grep postgres
    

    you will see like:

    501 1445 3645 0 12:05AM 0:00.03 postgres: sasha dbname [local] idle

    The third number (3645) is PID.

    You can delete this

    sudo kill -9 3645
    

    And after that start your PostgreSQL connection.

    Start manually:

    pg_ctl -D /usr/local/var/postgres start
    

提交回复
热议问题