无法还原pg_dump备份 [英] Unable to restore pg_dump backup
本文介绍了无法还原pg_dump备份的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正试图从Postgres 9.1.1恢复备份,该备份由以下人员创建:
I'm trying to restore backup from Postgres 9.1.1, which was created by:
pg_dump mydb > backup.sql
在Postgres 9.1.9上还原
restore on Postgres 9.1.9
psql -d mydb -f backup.sql
我收到此错误:
psql:datasets.sql:278537: invalid command \.
psql:datasets.sql:278544: ERROR: syntax error at or near "1"
LINE 1: 1 4446 49 253.412262 239.618317 0 211.54303 100.482948 197.1...
\。
是 COPY
命令,我想它应该在Postgres 9版本之间兼容吗?
The \.
is part of COPY
command, I guess it should be compatible between Postgres 9 versions, or it's not?
COPY data_136 (id, in_1, in_2, in_3, in_4, out_1) FROM stdin;
1 5.0999999 3.5 1.39999998 0.200000003 Iris-setosa
2 4.9000001 3 1.39999998 0.200000003 Iris-setosa
--- few more line cutted
150 5.9000001 3 5.0999999 1.79999995 Iris-virginica
\.
推荐答案
问题是由先前的错误引起的:
The problem was caused by earlier error:
ERROR: permission denied for schema pg_catalog
的权限被拒绝
我正在导入对数据库拥有所有特权的under用户,无论如何在 postgres
用户下运行导入解决了该问题。
I was importing the under user who has all privileges to databases, anyway running the import under postgres
user solved the issue.
这篇关于无法还原pg_dump备份的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文