无法删除数据库 [英] Can't delete database

查看:116
本文介绍了无法删除数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是PostgreSQL的新手,我认为它是一个简单的命令 DROP DATABASE DROPDB 。为什么以下命令不会删除我的数据库?

I'm new to PostgreSQL and am having a problem with what I perceive to be a simple command DROP DATABASE and DROPDB. Why would the following commands not delete my database?

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)


推荐答案

您在命令后忘记了分号; 。尝试:

You forgot the semicolon ; after the command. Try:

DROP DATABASE clientms;

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

The incomplete command is also indicated by the prompt: - instead of =. This is to allow multi-line commands.

这篇关于无法删除数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆