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: 15 Jan 2006 00:08:42 -0500
- Message-id: <87lkxixelh.fsf@stark.xeocode.com> <text/plain>
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
Home |
Main Index |
Thread Index