繁体   English   中英

pg_restore toc 错误

[英]pg_restore toc error

我对 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

转储成功且没有错误,但是恢复出现了一些错误,我正在使用相同的用户和特权在同一台机器上进行转储和恢复...

我也尝试过其他格式,plain、tar、compressed 都得到同样的错误..

我的 pg 版本是 8.4.11,psql 版本是 8.4.11

我不确定是什么导致这些错误.. 谁能帮我

 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...

这做到了

pg_dump database_name -c -Ft -f file_name.tar 

pg_restore -d database_name -c file_name.tar

在此之前,我试图在不包括 -c(clean) 的情况下进行恢复

即使 -c 包含在 pg_dump 中,它也不会在 pg_restore 中使用,除非我们说要使用...

在我的情况下的解决方案:

pg_restore --verbose --clean --no-acl --no-owner -h localhost -U username -d database_name dump_name.dump

对我有用:

增加max_wal_size PostgreSQL中设定(max_wal_size = 2GB) postgresql.conf

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM