Search Postgresql Archives

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

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

 



> 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@xxxxxxxxxxxxxxx
http://www.killerbytes.com/
(303) 722-0567 voice




[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