Skip site navigation (1) Skip section navigation (2)

Re: pervasiveness of surrogate (also called synthetic) keys

From: Jeff Davis <pgsql(at)j-davis(dot)com>
To: Rob Sargent <robjsargent(at)gmail(dot)com>
Cc: Greg Smith <greg(at)2ndQuadrant(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: pervasiveness of surrogate (also called synthetic) keys
Date: 2011-05-03 18:51:20
Message-ID: 1304448680.6858.4.camel@jdavis-ux.asterdata.local (view raw or flat)
Thread:
Lists: pgsql-general
On Mon, 2011-05-02 at 20:06 -0600, Rob Sargent wrote:
> Jeff Davis wrote:
> > In particular, I think you are falsely assuming that a natural key must
> > be generated from an outside source (or some source outside of your
> > control), and is therefore not reliably unique.
> >
> > You can generate your own keys...

...

> My wife works (at the sql level) with shall we say "records about 
> people".  Real records, real people.  Somewhere around 2 million unique 
> individuals, several million source records.  They don't all have ssn, 
> they don't all have a drivers license.  They don't all have an address, 
> many have several addresses (especially over time) and separate people 
> have at one time or another lived at the same address.  You would be 
> surprise how many "bob smith"s where born on the same day.  But then 
> they weren't all born in a hospital etc etc etc.  A person may present 
> on any of a birth record, a death record, a hospital record, a drivers 
> license, a medical registry, a marriage record and so on.  There simply 
> is no natural key for a human.  We won't even worry about the 
> non-uniqueness of ssn. And please don't get her started on twins. :) 
> 
> 
> I can only imagine that other equally complex entities are just as 
> slippery when it comes time to pinpoint the natural key.

I think you missed my point. You don't have to rely on natural keys that
come from somewhere else; you can make up your own, truly unique
identifier.

Regards,
	Jeff Davis


In response to

Responses

pgsql-general by date

Next:From: Rob SargentDate: 2011-05-03 19:35:28
Subject: Re: pervasiveness of surrogate (also called synthetic) keys
Previous:From: Joshua D. DrakeDate: 2011-05-03 18:44:07
Subject: Re: [ADMIN] Can we Flush the Postgres Shared Memory ?

Privacy Policy | About PostgreSQL
Copyright © 1996-2013 The PostgreSQL Global Development Group