[英]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.