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

前端 未结 17 1792
一向
一向 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条回答
  •  一向
    一向 (楼主)
    2020-12-12 09:05

    GUI solution using pgAdmin 4

    First enable show activity on dashboard if you haven't:

    File > Preferences > Dashboards > Display > Show Activity > true
    

    Now disable all the processes using the db:

    1. Click the DB name
    2. Click Dashboard > Sessions
    3. Click refresh icon
    4. Click the delete (x) icon beside each process to end them

    You should now be able to delete the db.

提交回复
热议问题