我是 PostgreSQL 的新手,正在尝试理解它。我熟悉数据库和 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";
- Shahin Dohan