On Thu, Jun 16, 2016 at 10:32 AM, Jean-Francois Prieur <jfprieur@xxxxxxxxx> wrote:
1) Is there any way to tell pg_dump the order in which the tables should be dumped?2) Am I correct to assume that if I use the --disable-trigger option in pg_restore it should mitigate the problem? This only works on a data-only dump per the documentation, so if I am doing the initial copy of the database to the new server, will data-only give me everything I need or is it only good for incremental updates to an already running copy of a database?3) Alternatively, is there a psql command that I could run on the new server to disable all triggers/constraint checking, run the restore and then re-enable them?4) Since we are in a lab environment, I can shut down the server and copy the folder containing the database to the new server. Is this kosher? I could then try the data-only dump and restore in 2) to keep them updated.Sorry for the noobish questions, thank you for your time. Coming from mysql so the concepts are familiar but the execution different!
Firstly, what version of postgres are you using? What format are you dumping the file to?
When you dump using the compressed format, the pg_restore process will not have an FK's until such time that the data is entirely loaded.