Search Postgresql Archives

Re: creation of foreign key without checking prior data?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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/

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux