Re: string PK vs. interger PK

Поиск
Список
Период
Сортировка
От Dan Langille
Тема Re: string PK vs. interger PK
Дата
Msg-id 20020415200405.9BCD93F28@bast.unixathome.org
обсуждение исходный текст
Ответ на Re: string PK vs. interger PK  ("Nick Fankhauser" <nickf@ontko.com>)
Список pgsql-admin
On 15 Apr 2002 at 14:20, Nick Fankhauser wrote:

> As a general rule, a primary key (or any relationship key) should not
> contain a value that means something beyond its use in relating entities.
> The problem is that if a field describes an object, the day may come when
> you want to change the description, but you *never* want to change the
> field that identifies the record and relates it to other records.

FWIW, I would recommend not using business values as a primary key (and by
extension, as a foreign key).  Business values are just that: business
values.  Sure, put unique constraints on business values if you want.
Just don't make them a primary key or a foreign key.
--
Dan Langille
The FreeBSD Diary - http://freebsddiary.org/ - practical examples


В списке pgsql-admin по дате отправления:

Предыдущее
От: "Marc Mitchell"
Дата:
Сообщение: Re: string PK vs. interger PK
Следующее
От: "Bojan Belovic"
Дата:
Сообщение: Killing a child process