微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

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

使用ps_restore恢复备份数据库出错:pg_restore: [archiver] input file does not appear to be a valid archive

使用
pg_dump -Fp -t mytable > mytable_back


g_dump -t mytable > mytable_back

备份出来的为脚本(纯文本)文件,不能直接使用pg_restore进行恢复

需要使用命令psql \i

user>psql -U username -d mydb
username=# \i mytable_back


pg_dump和pg_restore的时候使用 格式为 custom(-F c )或tar格式(-F t)即可进行恢复

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐