我是新来PostgreSQL和我有什么我认为是一个简单的命令中的问题DROP DATABASE和DROPDB.为什么以下命令不会删除我的数据库?
postgres=# drop database clientms
postgres-# \l
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges
-----------+--------------+----------+-------------+-------------+-----------------------
clientms | clientmsuser | UTF8 | en_GB.UTF-8 | en_GB.UTF-8 |
postgres | postgres | UTF8 | en_GB.UTF-8 | en_GB.UTF-8 |
template0 | postgres | UTF8 | en_GB.UTF-8 | en_GB.UTF-8 | =c/postgres +
| | | | | postgres=CTc/postgres
template1 | postgres | UTF8 | en_GB.UTF-8 | en_GB.UTF-8 | =c/postgres +
| | | | | postgres=CTc/postgres
(4 rows)
postgres-# dropdb clientms
postgres-# \l
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges
-----------+--------------+----------+-------------+-------------+-----------------------
clientms | clientmsuser | UTF8 | en_GB.UTF-8 | en_GB.UTF-8 |
postgres | postgres | UTF8 | en_GB.UTF-8 | en_GB.UTF-8 |
template0 | postgres | UTF8 | en_GB.UTF-8 | en_GB.UTF-8 | =c/postgres +
| | | | | postgres=CTc/postgres
template1 | postgres | UTF8 | en_GB.UTF-8 | en_GB.UTF-8 | =c/postgres +
| | | | | postgres=CTc/postgres
(4 rows)
Run Code Online (Sandbox Code Playgroud)
Erw*_*ter 22
你忘记;了命令后面的分号.尝试:
DROP DATABASE clientms;
Run Code Online (Sandbox Code Playgroud)
不完整的命令也由提示符表示:-而不是=.这是为了允许多行命令.
| 归档时间: |
|
| 查看次数: |
7976 次 |
| 最近记录: |