--View current Server databaseSELECTDatname fromPg_database--view the created user tableSELECT * fromPg_stat_user_tables--Create a databaseCREATE DATABASE"Fxsz_lt" withOWNER=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;--Deleting a databaseDROP DATABASElitao_test--CREATE TABLE SpaceCREATEtablespace "Litao_test" OWNER postgreslocation'/var/lib/pgsql/9.3/data'--Querying table SpacesSELECTSpcname fromPg_tablespace--where to query the tablespaceSELECTSpcname,pg_tablespace_location (OID) fromPg_tablespace--Delete Table SpaceDROPtablespace Products--Create a tableCREATE TABLEUserInfo (UserIDvarchar( -) not NULL, UserNamevarchar( -) not NULL, Userpwdvarchar( -) )--Inserting DataINSERT intoUserInfoVALUES('fxsz06046','Litao','SYSTEMG');--Querying table DataSELECT * fromUserInfo
Postgres 1th class database and table creation