1.查看表pg_database的结构
postgres=# \d pg_database
Table “pg_catalog.pg_database”
… …
2.查看有哪些数据库
select * from pg_database;
使用命令\l也可以看到有哪些数据库
3.链接一个数据库
\c postgres
\c 不带任何选项显示处于哪个数据库中
select current_database()也可以显示当前数据库
4.显示有哪些schema
\dn
5.创建schema
create schema pg200_schema1;
设置当前schema
set search_path to pg200_schema1;
6.显示有哪些tablespace
\db
7.创建tablespace
postgres=# CREATE TABLESPACE “tbs3” LOCATION ‘/script_wgz/pgdata/tbs3’;
CREATE TABLESPACE