Re: Surrogate keys (Was: enums)

From: Greg Stark <gsstark(at)mit(dot)edu>
To: Leandro Guimarães Faria Corcete DUTRA <leandro(at)dutra(dot)fastmail(dot)fm>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Surrogate keys (Was: enums)
Date: 2006-01-15 05:08:42
Message-ID: 87lkxixelh.fsf@stark.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Leandro Guimarães Faria Corcete DUTRA <leandro(at)dutra(dot)fastmail(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message korry 2006-01-15 16:14:05 Coding standards? Recommendations?
Previous Message Qingqing Zhou 2006-01-14 21:13:56 Re: Warm-up cache may have its virtue