Re: IS it a good practice to use SERIAL as Primary Key?

From: Scott Ribe <scott_ribe(at)killerbytes(dot)com>
To: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>, John McCawley <nospam(at)hardgeus(dot)com>
Cc: pgsql general <pgsql-general(at)postgresql(dot)org>
Subject: Re: IS it a good practice to use SERIAL as Primary Key?
Date: 2006-11-27 23:53:43
Message-ID: C190C897.5C2DE%scott_ribe@killerbytes.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> A artificial does not protect against duplication.
>
> That's it, in a nut shell. There is no argument there. That is why you
> don't use artificial keys.

Sure, but in many cases natural primary keys simply do not exist. (People
being the prime example.) Many examples of what are proposed as natural
primary keys are actually not--they are very often non-unique or prone to
change, or both.

Relational theory is quite powerful, but its dogmatic application often
conflicts with the mess that is the real world. Given a choice between a
synthetic primary key and a sloppy approximation of a natural one (or even
an accurate-looking one handed to me by a clean-shaven guy in an expensive
suit), I'll take the synthetic one because my experience has been that over
the long term it will cause fewer problems by far.

--
Scott Ribe
scott_ribe(at)killerbytes(dot)com
http://www.killerbytes.com/
(303) 722-0567 voice

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Joshua D. Drake 2006-11-28 00:02:54 Re: IS it a good practice to use SERIAL as Primary Key?
Previous Message John McCawley 2006-11-27 23:31:55 Re: IS it a good practice to use SERIAL as Primary Key?