Skip site navigation (1) Skip section navigation (2)

Re: Imperfect solutions

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Christopher Kings-Lynne" <chriskl(at)familyhealth(dot)com(dot)au>
Cc: "Bruce Momjian" <pgman(at)candle(dot)pha(dot)pa(dot)us>, "PostgreSQL-development" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Imperfect solutions
Date: 2001-05-31 05:09:05
Message-ID: 9857.991285745@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackers
"Christopher Kings-Lynne" <chriskl(at)familyhealth(dot)com(dot)au> writes:
> Also, what about foreign keys?  At the moment it is incredibly complicated
> to determine all the foreign keys on a table, what column(s) they're defined
> over, what column(s) they reference and what their behaviour is.  And just
> try writing code (like I am) that tries to drop them by name, let alone list
> them!!!

Indeed.  You're looking at the aftermath of an "imperfect fix" to add
foreign keys.  With all due respect to Jan and Stephan, who did a great
job adding the feature at all, there are still a lot of things that need
to be fixed in that area.  The trouble with imperfect fixes is that they
tend to get institutionalized if they're left in the code for any length
of time --- people write more code that depends on the hack, or works
around some of its shortcomings, or whatever, and so it gets harder and
harder to rip out the hack and replace it with something better.
Especially if the original author moves on to other challenges instead
of continuing to work on improving his first try.  Other people are
likely to have less understanding of the code's shortcomings.

I don't object to imperfect fixes when they buy us a useful amount of
functionality in a critical area (as indeed the current foreign-key code
does).  But I have more of a problem with doing things that way for
marginal feature additions.  I think that in the long run the downside
outweighs the upside in cases like that.

			regards, tom lane

In response to

Responses

pgsql-hackers by date

Next:From: EricDate: 2001-05-31 05:42:41
Subject: SQL( "if ...exists...),how to do it in the PostgreSQL?
Previous:From: Joe ConwayDate: 2001-05-31 04:59:52
Subject: remote database queries

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group