1.备份表中的数据
D:\Program Files\PostgreSQL-8.3.7\bin\pg_dump.exe -h *.*.*.* -p 5432 -U username -F c -v -f "D:\Program Files\PostgreSQL-8.3.7\bin\sss.backup" -t "\"public\".\"tablename\"" databasename
2. 创建表
CREATE TABLE tablename
(
id bigint,
createtime timestamp without time zone,
modifyname character varying(255),
modify_date timestamp without time zone,
modify_detail character varying(100000),
"name" character varying(255),
state character varying(255),
optlock integer,
work_id character varying(255),
"type" character varying(255),
lat double precision,
lng double precision,
"location" geometry,
pinyininitials character varying(255),
district character varying(255),
name_en character varying(255),
sortby integer
)
WITH (OIDS=FALSE);
ALTER TABLE tablename OWNER TO username;
3.恢复表中的数据
D:\Program Files\PostgreSQL-8.3.7\bin>pg_restore -h *.*.*.* -U usrename -
d databasename -a -t tablename -v "D:\Program Files\PostgreSQL-8.3.7\bin\sss.back
up"
posted on 2010-03-11 10:02
冰是没有未来的,因为它的永恒 阅读(337)
评论(0) 编辑 收藏 所属分类:
postges database