Answer the question
In order to leave comments, you need to log in
How to deal with the order of restoring tables?
All my life I've been dumping pg_dump bases, and uploading psql base < file
But then I ran into a complex database, where keys in tables point to other tables. As a result, when restoring, I get a bunch of errors like relation "name" does not exist
. And I still don't understand how to solve this ...
The documentation for older versions contains options for managing the restore order, but there is nothing like this in the new ones. Is it possible to dump table by table and restore as well? Absurd!
How to be?
Answer the question
In order to leave comments, you need to log in
In general, for some unknown reason, the order of restoring tables was not followed. The keys referring to the not yet deployed table were restored to the current table. In theory, everything worked, but who likes mountains of errors?
It was decided by separate recovery of the database schema first (key pg_restore -s), and then only data (pg_restore -a). And of course --disable-triggers
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question