我是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)
你忘记了分号;在命令之后.尝试:
原文链接:https://www.f2er.com/postgresql/192369.htmlDROP DATABASE clientms;
不完整的命令也由提示符指示: – 而不是=.这是为了允许多行命令.