postgresql pg_restore toc 错误
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/9836627/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
pg_restore toc error
提问by MAHI
i was using the following syntax for pg_dump and restore
我对 pg_dump 和 restore 使用以下语法
pg_dump eval --inserts -b -c --encoding UTF8 -Fc -f eval.sql.tar.gz -x -U postgres
createdb -T template0 test -U postgres
pg_restore -d test eval.sql.tar.gz -e -U postgres
the dump was successfull with no errors, but restore makes a some errors, i am dumping and restoring in same machine with same user and privilege all...
转储成功且没有错误,但是恢复出现了一些错误,我正在使用相同的用户和特权在同一台机器上进行转储和恢复...
i have tried out with other formats also, plain, tar, compressed all gets the same error..
我也尝试过其他格式,plain、tar、compressed 都得到同样的错误..
my version of pg is 8.4.11 and psql version is 8.4.11
我的 pg 版本是 8.4.11,psql 版本是 8.4.11
i am not sure what makes these errors.. can anyone help me
我不确定是什么导致这些错误.. 谁能帮我
pg_restore: [archiver (db)] Error while PROCESSING TOC:
pg_restore: [archiver (db)] Error from TOC entry 4965; 0 138871 TABLE DATA ir_act_report_xml insigni
pg_restore: [archiver (db)] could not execute query: ERROR: invalid input syntax for integer: "purchase.order"
LINE 1: ...st for Quotation', 'ir.actions.report.xml', NULL, 'purchase....
^
Command was: INSERT INTO ir_act_report_xml VALUES (350, 'Request for Quotation', 'ir.actions.report.xml', NULL, 'purchase.order', 'purcha...
回答by MAHI
this did the trick
这做到了
pg_dump database_name -c -Ft -f file_name.tar
pg_restore -d database_name -c file_name.tar
before this i was trying to restore with out including -c(clean)
在此之前,我试图在不包括 -c(clean) 的情况下进行恢复
even though -c is included in pg_dump it is not used in pg_restore unless we say to use...
即使 -c 包含在 pg_dump 中,它也不会在 pg_restore 中使用,除非我们说要使用...
回答by AkashP
The solution in my case:
在我的情况下的解决方案:
pg_restore --verbose --clean --no-acl --no-owner -h localhost -U username -d database_name dump_name.dump