在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 ] name
Example
Following is a simple example, which will delete testdb from your PostgreSQL schema:
postgres=# DROP DATABASE testdb; postgres-#


&spm=1001.2101.3001.11974&articleId=52201381&d=1&t=3&u=a327f08e6afd48098df31e162bff71d7)

被折叠的 条评论
为什么被折叠?



