--查看当前服务器数据库SELECT datname FROM pg_database--查看创建的用户表SELECT * FROM pg_stat_user_tables--创建一个数据库CREATE DATABASE "fxsz_lt"WITH OWNER=postgresENCODING='UTF8'TABLESPACE=pg_default--LC_COLLATE='Chinese (Simplified)_People''s Republic of China.936'--LC_CTYPE='Chinese (Simplified)_People''s Republic of China.936'CONNECTION LIMIT=-1;--删除数据库DROP DATABASE litao_test--创建表空间CREATE TABLESPACE "litao_test" OWNER postgresLOCATION '/var/lib/pgsql/9.3/data'--查询表空间SELECT spcname FROM pg_tablespace--查询表空间所在的位置SELECT spcname,pg_tablespace_location(oid)FROM pg_tablespace--删除表空间DROP TABLESPACE products--创建表CREATE TABLE UserInfo( UserID varchar(50) NOT NULL, UserName varchar(50) NOT NULL, UserPwd varchar(50) )--插入数据INSERT INTO UserInfo VALUES('fxsz06046','litao','systemg');--查询表数据SELECT * FROM UserInfo