【发布时间】:2012-01-28 09:57:19
【问题描述】:
我是 PostgreSQL 的新手,我试图理解它。我对 db 和 MySQL 很熟悉。
我正在尝试删除我创建的数据库,因为 psql 似乎忽略了我尝试通过 Django 推送的更改。
当我执行\l 时,我得到以下响应:
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges
------------------+--------+----------+-------------+-------------+-------------------
postgres | neurix | UTF8 | en_AU.UTF-8 | en_AU.UTF-8 |
test_db | neurix | UTF8 | en_AU.UTF-8 | en_AU.UTF-8 |
template0 | neurix | UTF8 | en_AU.UTF-8 | en_AU.UTF-8 | =c/neurix +
| | | | | neurix=CTc/neurix
template1 | neurix | UTF8 | en_AU.UTF-8 | en_AU.UTF-8 | =c/neurix +
| | | | | neurix=CTc/neurix
template_postgis | neurix | UTF8 | en_AU.UTF-8 | en_AU.UTF-8 |
(5 rows)
现在我想用
删除数据库“test_db”DROP DATABASE test_db
但是当我之后执行\l 时,表格仍然存在,并且概览看起来差不多。
【问题讨论】:
-
您可能还想尝试使用双引号:
DROP DATABASE "mydb";
标签: postgresql psql