Re: Primary Key
От | James B. Byrne |
---|---|
Тема | Re: Primary Key |
Дата | |
Msg-id | 61136.69.157.43.4.1195857334.squirrel@webmail.harte-lyne.ca обсуждение исходный текст |
Ответ на | Primary Key (João Paulo Zavanela <joao_zava@globo.com>) |
Ответы |
Re: Primary Key
|
Список | 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 по дате отправления: