Re: pg_dump | pg_sql: insert commands and foreign key constraints

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>
Cc: Alan Hodgson <ahodgson(at)simkin(dot)ca>, pgsql-general(at)postgresql(dot)org
Subject: Re: pg_dump | pg_sql: insert commands and foreign key constraints
Date: 2008-09-24 02:20:35
Message-ID: 17027.1222222835@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Craig Ringer <craig(at)postnewspapers(dot)com(dot)au> writes:
> IIRC a patch was circulating (maybe applied to 8.4?) that tries to map
> foreign-key relationships and where possible dump data in dependency
> order so that data-only dumps without circular foreign key references
> will restore correctly with no special user action.

Yeah. Historically pg_dump has not worried about foreign keys at all
during data-only dumps. As of CVS HEAD there is some code in there that
will sort the tables according to foreign key constraints, although it
is possible to have circular constraints or self-referential constraints
that defeat this.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2008-09-24 02:50:41 Re: Using a User-Def function in a query
Previous Message Craig Ringer 2008-09-24 01:02:20 Re: pg_dump | pg_sql: insert commands and foreign key constraints