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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Miles Keaton <mileskeaton(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: pg_dump dumping data in order? (used to in 7.4 but not now in 8?)
Date: 2005-02-12 02:58:03
Message-ID: 17696.1108177083@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Miles Keaton <mileskeaton(at)gmail(dot)com> 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2005-02-12 03:02:29 Re: test datatype for ANY
Previous Message Michael Fuhr 2005-02-12 02:51:21 Re: test datatype for ANY