在win下用客户端,基本上不需要记录什么命令了,在linux不一样做个标记:
显示所有数据库:
\l List of databases Name | Owner | Encoding | Collate | Ctype | Access privileges -----------+----------+----------+---------+-------+----------------------- postgres | postgres | UTF8 | C | C | template0 | postgres | UTF8 | C | C | =c/postgres + | | | | | postgres=CTc/postgres template1 | postgres | UTF8 | C | C | =c/postgres + | | | | | postgres=CTc/postgres testdb | postgres | UTF8 | C | C | 选择数据库: postgres=# \c testdb; psql (9.2.4) Type "help" for help. You are now connected to database "testdb" as user "postgres". testdb=#删除数据库
DROP DATABASE [ IF EXISTS ] nameFollowing is a simple example, which will delete testdb from your PostgreSQL schema:
postgres=# DROP DATABASE testdb; postgres-#