Re: [GENERAL] pg_dump dumping data in order? (used to in 7.4 but not now in 8?)

2005-02-12 Thread Miles Keaton
use --disable-triggers

Hey! Cool. Worked. Thanks!

---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]


[GENERAL] pg_dump dumping data in order? (used to in 7.4 but not now in 8?)

2005-02-11 Thread Miles Keaton
When I do a pg_dump, (--data-only), PG7 used to dump the data out in
order, so that all foreign-key checks worked correctly when loading
the data back in.

Now it seems with PG8 it's dumping it completely out of order (one of
my completely foreign-key join tables first!) - and I can't get it to
dump in the correct order.

Anyone know a solution to this, to get a data dump to export in a
correct order so that foreign-key checks will work when loading that
data in again?

---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
  subscribe-nomail command to [EMAIL PROTECTED] so that your
  message can get through to the mailing list cleanly


Re: [GENERAL] pg_dump dumping data in order? (used to in 7.4 but not now in 8?)

2005-02-11 Thread Tom Lane
Miles Keaton [EMAIL PROTECTED] writes:
 When I do a pg_dump, (--data-only), PG7 used to dump the data out in
 order, so that all foreign-key checks worked correctly when loading
 the data back in.

If it did so, it was by pure luck.

In general it is not possible for pg_dump to guarantee this works;
consider circular FK constraints, or FK constraints added since the
dump occurred.  In view of that, pg_dump has never tried to ensure
that data-only dumps are in a valid order at all.  The usual
approach is to use --disable-triggers to short-circuit the FK
constraints during the load.

regards, tom lane

---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send unregister YourEmailAddressHere to [EMAIL PROTECTED])