PostgreSQL: Drop Database but DB is still there

六月ゝ 毕业季﹏ 提交于 2019-12-03 14:48:50

问题


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

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

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

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


回答1:


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



来源:https://stackoverflow.com/questions/9044379/postgresql-drop-database-but-db-is-still-there

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!