Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2833022
  • 博文数量: 200
  • 博客积分: 2413
  • 博客等级: 大尉
  • 技术积分: 3067
  • 用 户 组: 普通用户
  • 注册时间: 2011-04-01 22:07
文章分类

全部博文(200)

文章存档

2018年(2)

2017年(8)

2016年(35)

2015年(14)

2014年(20)

2013年(24)

2012年(53)

2011年(44)

分类: Mysql/postgreSQL

2016-03-08 09:52:02


pg_restore
pg_restore用于恢复pg_dump导出的非纯文本格式备份。pg_dump默认是-Ft(plain text)参数,也就是纯文本备份。

参数:

-F, --format=c|t|p       output file format (custom, tar, plain text)


纯文本备份(-Ft)使用pg_restore会报错,如下

$ pg_dump -t member -Uszlsd -W szlsd_db -f /gpbackup/member.dmp 

 

$ pg_restore -d szlsd_db /gpbackup/member.dmp 

pg_restore: [archiver] input file does not appear to be a valid archive



当pg_dump时使用-Fc或者-Ft,就可以利用pg_restore进行恢复

$ pg_dump -t member -Fc -Uszlsd -W szlsd_db -f /gpbackup/member_c.dmp

 

$ pg_restore -d szlsd_db /gpbackup/member_c.dmp



转载请注明:
十字螺丝钉
http://blog.chinaunix.net/uid/23284114.html

QQ:463725310
E-MAIL:houora#gmail.com(#请自行替换为@)
阅读(5457) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~