Re: creation of foreign key without checking prior data?

From: Sam Mason <sam(at)samason(dot)me(dot)uk>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: creation of foreign key without checking prior data?
Date: 2009-09-17 19:00:17
Message-ID: 20090917190017.GS5407@samason.me.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Sep 17, 2009 at 08:34:20PM +0200, hubert depesz lubaczewski wrote:
> On Thu, Sep 17, 2009 at 01:22:52PM -0500, Peter Hunsberger wrote:
> > You can't have a foreign key that doesn't have relational integrity,
> > it is no longer a foreign key.
>
> you do realize that having foreign key defined doesn't guarantee
> integrity?

The obvious cases would be software bugs and bad hardware. What else?
Huh, how about users scribbling over PG's files! Not sure where to
classify that but could either happen maliciously or accidentally as the
result of trying to clean up.

By having an override here you seem to be saying that you ultimately
trust yourself more than PG and/or the hardware its running on. I
suppose the trade off is time you *may* spend cleaning up later on if
this isn't true vs. the time PG *will* spend verifying the constraint
now. Interesting trade off, never really considered it before.

Sounds valid, though the general mantra here is that PG knows best. Is
that always true?

--
Sam http://samason.me.uk/

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Scott Marlowe 2009-09-17 19:10:31 Re: limiting query time and/or RAM
Previous Message Alan McKay 2009-09-17 18:56:42 limiting query time and/or RAM