- PostgreSQL支持标准的SQL类型:int, smallint, real, double, precisio(精确类型) char(N), varchar(N), date, time, timestamp,和 interval
- 创建数据库
createdb dbname - 表操作
- 创建表:
CREATE TABLE weather (
city varchar(80),
temp_lo int, -- low temperature
temp_hi int, -- high temperature
prcp real, -- precipitation
date date
);
删除表:
DROP TABLE tablename;插入:
INSERT INTO weather VALUES(‘beijing’, 10, 20, 0.25, ‘2015-10-10’);