PostgreSQL:删除数据库,但数据库仍然存在 [英] PostgreSQL: Drop Database but DB is still there

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

问题描述

我是PostgreSQL的新手,所以我尽力掌握它。我对db和MySQL很熟悉。

I am new to PostgreSQL and I try to get my head around it. I am familiar to db's and MySQL.

我试图删除数据库,因为psql似乎忽略了我尝试通过Django进行的更改,所以我创建了该数据库。

I am trying to delete database, which I created since psql seems to ignore the changes I try to push through Django.

当我执行 \l 时,我得到以下响应:

When I execute \l I get the following response:

                                  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)

现在,我要使用

Now I wan to drop the database "test_db" with

DROP DATABASE test_db

,但是当我随后执行 \l 时,表仍然存在,并且概览看起来像这样。

but when I execute \l afterwards, the table is still there and the overview looks like about.

推荐答案

是否在 DROP DATABASE test_db 之后键入; ? PostgreSQL是否打印了对您命令的响应?

Did you type a ; after the DROP DATABASE test_db? Did PostgreSQL print a response to your command?

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

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