Re: pg_dump and foreign keys troubles

From: "Jim C(dot) Nasby" <jim(at)nasby(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Paolo Negri <hungrylist(at)gmail(dot)com>, pgsql-admin(at)postgresql(dot)org
Subject: Re: pg_dump and foreign keys troubles
Date: 2006-11-09 07:13:26
Message-ID: 20061109071325.GG90133@nasby.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Tue, Nov 07, 2006 at 04:42:35PM -0500, Tom Lane wrote:
> "Paolo Negri" <hungrylist(at)gmail(dot)com> writes:
> > My problem is that I have to load the dump (from a 7.3) in a brand new
> > database (8.1) and then I need to do quite a few changes to the schema
> > dropping some old foreign constraint and adding some different ones.
> > ...
> > How can I tell to pg_dump to dump the schema with foreign keys
> > construct instead of creating constraint trigger?
>
> You can't: the information just isn't there in 7.3. You'll need to look
> at the trigger arguments and reconstruct the FKs.
>
> IIRC the contrib/adddepend script might be able to help you with this.

Would a 7.4 or newer pg_dump connecting to a 7.4 database know enough to
do this for you? If so, Paolo could restore his dump to a 7.3 install
and go from there...
--
Jim Nasby jim(at)nasby(dot)net
EnterpriseDB http://enterprisedb.com 512.569.9461 (cell)

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Jim C. Nasby 2006-11-09 07:15:49 Re: Use Jobs
Previous Message Jim C. Nasby 2006-11-09 07:11:19 Re: Manual sys catalog constraint setup to avoid downtime?