Re: Primary Key - Mailing list pgsql-general

From James B. Byrne
Subject Re: Primary Key
Date
Msg-id 61136.69.157.43.4.1195857334.squirrel@webmail.harte-lyne.ca
Whole thread Raw
In response to Primary Key  (João Paulo Zavanela <joao_zava@globo.com>)
Responses Re: Primary Key  (Michael Glaesemann <grzm@seespotcode.net>)
List pgsql-general
On: Fri, 23 Nov 2007 09:33:13 +0000, "Peter Childs" <peterachilds@gmail.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@Harte-Lyne.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


pgsql-general by date:

Previous
From: "Kevin Grittner"
Date:
Subject: Re: [HACKERS] Transaction question
Next
From: Michael Glaesemann
Date:
Subject: Re: Primary Key