| From: | "James B(dot) Byrne" <byrnejb(at)harte-lyne(dot)ca> | 
|---|---|
| To: | pgsql-general(at)postgresql(dot)org | 
| Subject: | Re: Primary Key | 
| Date: | 2007-11-23 22:35:34 | 
| Message-ID: | 61136.69.157.43.4.1195857334.squirrel@webmail.harte-lyne.ca | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-general | 
On: Fri, 23 Nov 2007 09:33:13 +0000, "Peter Childs" <peterachilds(at)gmail(dot)com>
wrote:
> The worse thing I meet is people who think primary keys need to be
> integer single field unique serial fields
>
> I tend to agree that primary keys should be single fields if they
> need to be referenced but should also be natural if at all possible.
> ie use car number plates rather than some serial int.
Why is this desire not better satisfied by an index rather than a key? 
Any key into a relation is, in the final analysis, an arbitrary value. 
Why is a data value considered intrinsically superior to a sequence?
I am converting a system from HP TruboImage to PostgreSQL and the
framework selected, Ruby on Rails, essentially depends upon the existence
of an integer sequenced primary key for each row.  Originally I had a deep
distaste for the artificiality of integer keys but now I really do not
consider them any more, or less, coercive than many other programming
conventions.
Regards,
-- 
***          E-Mail is NOT a SECURE channel          ***
James B. Byrne                mailto:ByrneJB(at)Harte-Lyne(dot)ca
Harte & Lyne Limited          http://www.harte-lyne.ca
9 Brockley Drive              vox: +1 905 561 1241
Hamilton, Ontario             fax: +1 905 561 0757
Canada  L8E 3C3
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Michael Glaesemann | 2007-11-23 22:44:00 | Re: Primary Key | 
| Previous Message | Kevin Grittner | 2007-11-23 21:54:39 | Re: [HACKERS] Transaction question |