postgresql – 无法删除数据库

前端之家收集整理的这篇文章主要介绍了postgresql – 无法删除数据库前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我是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)
你忘记了分号;在命令之后.尝试:
DROP DATABASE clientms;

不完整的命令也由提示符指示: – 而不是=.这是为了允许多行命令.

猜你在找的Postgre SQL相关文章