刪除數據庫
更新時間 2025-02-05 09:36:25
最近更新時間: 2025-02-05 09:36:25
分享文章
本文為您介紹如何刪除數據庫。
-
刪除數據庫teledb_db_new
teledb=# drop database teledb_db_new;仍有會話連接數據庫時,會報錯
ERROR: database "teledb_db_new" is being accessed by other users DETAIL: There is 1 other session using the database. -
停止該數據庫的所有連接后重新刪除數據庫
teledb=# select pg_terminate_backend(pid) from pg_stat_activity where datname='teledb_db_new'; pg_terminate_backend ---------------------- t (1 row) teledb=# drop database teledb_db_new; DROP DATABASE