B
B
Bogdan2017-10-02 16:15:39
PostgreSQL
Bogdan, 2017-10-02 16:15:39

Errors while restoring dump?

Hello. When restoring the database and dump, there were errors, how to fix them correctly?
Maybe you can somehow correct the base from which the dump is done? Thank you.


CONTEXT: COPY dishes, line 1
pg_restore: [archiver (db)] Error from table of contents entry 2769; 0 35095 TABLE DATA institutions postgres
pg_restore: [archiver(db)] failed COPY command for table "institutions": ERROR: duplicate key value violates unique constraint "institutions_pkey"
DETAIL: Key (id)=(6) already exists.
...
pg_restore: [archiver (DB)] Error from TOC entry 2539; 2606 36198 CONSTRAINT dishes_pkey postgres pg_restore
: [archiver (db)] could not execute query: ERROR: multiple primary keys for table "dishes" are not allowed ...
DETAIL: Key (product_id)=(118) is not present in table "products".
The command was executed: ALTER TABLE ONLY io_correction_products
ADD CONSTRAINT fk_rails_daec94aa5d FOREIGN KEY (product_id) REFERENCES products(...
pg_restore: [archiver
(DB)] could not execute query: ERROR: insert or update on table "children_groups" violates foreign key constraint "fk_rails_f9754c73dc"
... WARN
: Ignored errors during restore: 34

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Melkij, 2017-10-02
@melkij

Apparently you did a dump without --clean and are trying to restore to a database that is no longer empty.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question