From: Paolo Negri <hungrylist@gmail.com>
To: pgsql-admin@postgresql.org
Subject: pg_dump and foreign keys troubles
Date: Tue, 7 Nov 2006 17:25:21 +0000
Message-ID: <b242f69c0611070925m55bcd9eai3bc8c059cf389c56@mail.gmail.com> (raw)
Hi
I have a dump of a large DB executed with pg_dump (schema and data together).
The original schema declares some foreign keys constaints.
The problem is in the pg_dump all the foreign keys disappear from the
tables because thay are rendered instead as CREATE CONSTRAINT
TRIGGERS.
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.
Since the new datadabase restored from the dump doesn't know about the
old foreign keys but has just a bunch of constraint trigger, it
becomes really trichy to do this kind of job.
How can I tell to pg_dump to dump the schema with foreign keys
construct instead of creating constraint trigger?
If it's impossible what is the common practice to work arount this problem?
thanks
Paolo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: hungrylist@gmail.com
Subject: Re: pg_dump and foreign keys troubles
In-Reply-To: <b242f69c0611070925m55bcd9eai3bc8c059cf389c56@mail.gmail.com>
References: <b242f69c0611070925m55bcd9eai3bc8c059cf389c56@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox