There are 2 other sessions using the database

-- 刪除數據庫
DROP DATABASE TEST_DATABASE;

報錯信息

There are 2 other sessions using the database

問題原因

當前有其他連接在使用該數據庫。

解決

1、執行如下命令,斷開mctest數據庫所有的連接。

select pg_terminate_backend(pid) from (select pid from pg_stat_activity where datname = '[$Database_Name]' ) a;

2、刪除數據庫

DROP DATABASE TEST_DATABASE;

發佈了21 篇原創文章 · 獲贊 7 · 訪問量 1萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章