Re: Artificial Primary keys

From: Bernard Peek <bap_at_shrdlu.com>
Date: Sun, 27 Jan 2002 22:25:01 +0000
Message-ID: <PG0iaAC94HV8EwQV_at_shrdlu.com>


In message <3C51729B.6030803_at_racon-linz.at>, Heinz Huber <hhuber_at_racon-linz.at> writes
>Bernard Peek wrote:
>
>> In message <3c505454$0$89112$edfadb0f_at_dspool01.news.tele.dk>, Jan
>>Emil Larsen <jel_at_g-it.dk> writes
>>
>[snip]
>
>>> That is right. I goes the other way round: If it has information in
>>>it self,
>>> it may change.
>>> No-information in the key is a measure to secure immutability.
>> No, that's still not right. Immutability is important but artificial
>>keys are not the only way to get it. If you have a natural key that
>>truly identifies one and only one thing then it is immutable. If it
>>changes then either it wasn't a real key or someone recorded the wrong
>>value.
>
>Would you e.g. use the currency code as a natural key?
>It surely identifies one and only one currency!
>
>But beware, it may change without further notice when someone (probably
>a lot of someones!) at ISO decides so.

It's not a natural key, it's a surrogate. There are a lot of codes that are use as if they were natural keys, and the American SSN is a perfect example. It is a surrogate key created and maintained by a third party. How much do you trust the organisation that creates the codes?

-- 
Bernard Peek
bap_at_shrdlu.com

In search of cognoscenti
Received on Sun Jan 27 2002 - 23:25:01 CET

Original text of this message