Re: Surrogate keys (Was: enums)

Поиск
Список
Период
Сортировка
От Greg Stark
Тема Re: Surrogate keys (Was: enums)
Дата
Msg-id 87lkxixelh.fsf@stark.xeocode.com
обсуждение исходный текст
Ответ на Surrogate keys (Was: enums)  (Leandro Guimarães Faria Corcete DUTRA<leandro@dutra.fastmail.fm>)
Список pgsql-hackers
Leandro Guimarães Faria Corcete DUTRA <leandro@dutra.fastmail.fm> writes:

> Certainly decoupling presentation from storage would be nice, but even before 
> that generalised use of surrogate keys seems to me a knee-jerk reaction.

I hate knee-jerk reactions too, but just think of all the pain of people
dealing with databases where they used Social Security numbers for primary
keys. I would never use an attribute that represents some real-world datum as
a primary key any more.

In my experience there are very few occasions where I want a real non-sequence
generated primary key. I've never regretted having a sequence generated
primary key, and I've certainly had occasions to regret not having one.

-- 
greg



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

Предыдущее
От: "Qingqing Zhou"
Дата:
Сообщение: Re: Warm-up cache may have its virtue
Следующее
От: korry
Дата:
Сообщение: Coding standards? Recommendations?