Re: Surrogate keys (Was: enums) - Mailing list pgsql-hackers

From Martijn van Oosterhout
Subject Re: Surrogate keys (Was: enums)
Date
Msg-id 20060119072717.GA9949@svana.org
Whole thread Raw
In response to Re: Surrogate keys (Was: enums)  (Josh Berkus <josh@agliodbs.com>)
Responses Re: Surrogate keys (Was: enums)  (Josh Berkus <josh@agliodbs.com>)
List pgsql-hackers
On Wed, Jan 18, 2006 at 03:58:50PM -0800, Josh Berkus wrote:
> Martjin,
>
> > Interesting. However, in my experience very few things have "natural
> > keys". There are no combination of attributes for people, phone calls
> > or even real events that make useful natural keys.
>
> I certainly hope that I never have to pick up one of your projects.   A
> table without a natural key is a data management disaster.   Without a
> key, it's not data, it's garbage.

???

Please provides natural keys for any of the following:

- A Person
- A phone call: (from,to,date,time,duration) is not enough
- A physical address
- A phone line: (phone numbers arn't unique over time)
- An internet account: (usernames not unique over time either)

In any of these either misspellings, changes of names, ownership or
even structure over time render the obvious useless as keys. There are
techniques for detecting and reducing duplication but the point is that
for any of these duplicates *can* be valid data.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: No heap lookups on index
Next
From: Greg Stark
Date:
Subject: Re: Indexes vs. cache flushes