Search Postgresql Archives

Re: Primary Key

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

 



On: Fri, 23 Nov 2007 09:33:13 +0000, "Peter Childs" <peterachilds@xxxxxxxxx>
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@xxxxxxxxxxxxx
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


---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
       choose an index scan if your joining column's datatypes do not
       match

[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