简体   繁体   English

pg_restore toc 错误

[英]pg_restore toc error

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

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 中使用,除非我们说要使用...

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

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

This worked for me: 对我有用:

Increase the max_wal_size postgresql setting (max_wal_size = 2GB) in postgresql.conf增加max_wal_size PostgreSQL中设定(max_wal_size = 2GB) postgresql.conf

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

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