简体   繁体   English

pg_restore:[存档(db)]处理目录时出错:

[英]pg_restore: [archiver (db)] Error while PROCESSING TOC:

I have restored a database using pg_restore. 我已经使用pg_restore恢复了数据库。 I found that data is restored but it throwed a few errors. 我发现数据已还原,但引发了一些错误。 What's the reason for these errors? 这些错误的原因是什么?

This is the command using for restoring 这是用于还原的命令

pg_restore -U postgres -d newdb08aug19 -j5 remote pg_restore -U postgres -d newdb08aug19 -j5远程

pg_restore: [archiver (db)] Error while PROCESSING TOC:
pg_restore: [archiver (db)] Error from TOC entry 7616;
 2606 36663585 FK CONSTRAINT card_history_cashcard_id_fk unify37
pg_restore: [archiver (db)] could not execute query: ERROR:  relation "public.voucher" does not exist
    Command was: ALTER TABLE ONLY finance.card_history
    ADD CONSTRAINT card_history_cashcard_id_fk FOREIGN KEY (cashcard_id) REFERENCES pu...
pg_restore: [archiver (db)] Error from TOC entry 7614; 2606 36662489 FK CONSTRAINT card_history_coupon_id_fk unify37
pg_restore: [archiver (db)] could not execute query: ERROR:  relation "public.cpn" does not exist
    Command was: ALTER TABLE ONLY finance.card_history
    ADD CONSTRAINT card_history_coupon_id_fk FOREIGN KEY (coupon_id) REFERENCES public...
pg_restore: [archiver (db)] Error from TOC entry 7615; 2606 36663406 FK CONSTRAINT card_history_domno_fk unify37
pg_restore: [archiver (db)] could not execute query: ERROR:  relation "public.ssgdom" does not exist
    Command was: ALTER TABLE ONLY finance.card_history
    ADD CONSTRAINT card_history_domno_fk FOREIGN KEY (domno) REFERENCES public.ssgdom(...

What's the reason for these kind of errors? 这些错误的原因是什么?

You only dumped part of the database (probably using something like -n finance , which would only dump objects in that schema). 您仅转储了数据库的一部分(可能使用了-n finance类的东西,它只会转储该模式中的对象)。

So the foreign key constraints that reference table that are not included in the dump will cause an error message when the dump is restored. 因此,还原转储时, 包含在转储中的引用表的外键约束将导致错误消息。

Everything except the constraints will be restored correctly. 除约束以外的所有内容都将正确还原。

暂无
暂无

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

相关问题 pg_restore: [目录归档程序] 无法打开输入文件。 尝试恢复数据库时出错 - pg_restore: [directory archiver] could not open input file. Error while trying to restore DB pg_restore toc 错误 - pg_restore toc error pg_restore:[archiver(db)] SET row_security = off - pg_restore: [archiver (db)] SET row_security = off pg_restore错误:pg_restore:文件头中的[archiver]不支持的版本(1.13) - pg_restore error: pg_restore: [archiver] unsupported version (1.13) in file header pg_restore: [archiver] postgres 中的输入文件太短错误 - pg_restore: [archiver] input file is too short error in postgres pg_restore:[tar archiver] 在 tar 存档中找不到文件“toc.dat”的 header:- [PostgreSQL-11] pg admin 4 - pg_restore: [tar archiver] could not find header for file "toc.dat" in tar archive :- [PostgreSQL-11] pg admin 4 pg_restore:[存档]输入文件在使用Pgadmin 4的PostgreSQL中似乎不是有效的存档错误 - pg_restore: [archiver] input file does not appear to be a valid archive error in PostgreSQL using Pgadmin 4 pg_restore:[archiver]输入文件在ubuntu 18.04中使用Pgadmin 4的PostgreSQL中似乎不是有效的存档错误 - pg_restore: [archiver] input file does not appear to be a valid archive error in PostgreSQL using Pgadmin 4 in ubuntu 18.04 pg_restore: [archiver] 文件头中不受支持的版本 (1.13) - pg_restore: [archiver] unsupported version (1.13) in file header pg_restore: [archiver] 文件头中不支持的版本 (1.14) - pg_restore: [archiver] unsupported version (1.14) in file header
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM