pg_restore

pg_restore
1.备份表中的数据

  
D:\Program Files\PostgreSQL - 8.3 . 7 \bin\pg_dump.exe  - * . * . * . *   - 5432   - U username  - F c  - - " D:\Program Files\PostgreSQL-8.3.7\bin\sss.backup "   - " \ " 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  - * . * . * . *   - U usrename  -
d databasename 
- - t tablename  - " D:\Program Files\PostgreSQL-8.3.7\bin\sss.back
up "

你可能感兴趣的:(pg_restore)