From: Jan Wieck <JanWieck@Yahoo.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Christopher Kings-Lynne <chriskl@familyhealth.com.au>
Cc: Bruce Momjian <pgman@candle.pha.pa.us>
Cc: Stephan Szabo <sszabo@megazone.bigpanda.com>
Cc: Peter Childs <Blue.Dragon@blueyonder.co.uk>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: Re: ADD FOREIGN KEY (was Re: [GENERAL] 7.4Beta)
Date: Mon, 29 Sep 2003 20:40:05 -0400
Message-ID: <3F78D0E5.7050805@Yahoo.com> (raw)
In-Reply-To: <16699.1064809727@sss.pgh.pa.us>
References: <200309281940.h8SJe3O01852@candle.pha.pa.us>
<3F77ABA0.4070600@familyhealth.com.au>
<16699.1064809727@sss.pgh.pa.us>
Tom Lane wrote:
> Christopher Kings-Lynne <chriskl@familyhealth.com.au> writes:
>> I think we need someway of telling postgres to suppress a foreign key check.
>
> Well, the subtext argument here is "do we fix it by providing a way to
> suppress the check, or do we fix it by making the check fast enough to
> be tolerable?"
>
> I think the advantages of choice (b) are obvious --- it doesn't allow
> bogus data to be loaded accidentally, and it doesn't create a problem
> with loading existing 7.3 dump files that don't know how to suppress the
> check.
>
> If we find there is no way to do (b) acceptably well, then and only then
> would I want to consider (a).
I think I can accept it to be the choice of the DBA what to do. Pg_dump
has that kind of options already, one can choose between COPY and INSERT
for example. Why not adding the choice of dumping FKeys as ALTER TABLE
or CREATE CONSTRAINT TRIGGER?
The whole "original" idea (way back a few years ago) of doing it with
the CREATE CONSTRAINT TRIGGER command was, that your "backup" ought to
be consistent anyway. Finding out that your tape contains inconsistent
garbage _after_ your harddisk made that suspicious noise ... is a bit
late, isn't it?
That ALTER TABLE ... ADD CONSTRAINT needs to be improved, because at the
moment it is normally used we cannot make any assumptions about data
consistency, no question. But just because we have such a nice and
allways asked for ALTER TABLE command does not mean we have to force
every DBA of every well maintained and stable system to perform hourly
long nonsense-tests on known-to-be-good data.
Jan
--
#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me. #
#================================================== JanWieck@Yahoo.com #
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 using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: JanWieck@Yahoo.com, tgl@sss.pgh.pa.us, chriskl@familyhealth.com.au, pgman@candle.pha.pa.us, sszabo@megazone.bigpanda.com, Blue.Dragon@blueyonder.co.uk
Subject: Re: ADD FOREIGN KEY (was Re: [GENERAL] 7.4Beta)
In-Reply-To: <3F78D0E5.7050805@Yahoo.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