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 21:08:33
Message-ID: 1304456913.6858.151.camel@jdavis-ux.asterdata.local
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, 2011-05-03 at 13:35 -0600, Rob Sargent wrote:
> Sorry, but I'm confused, but that's common. Isn't a "natural key" to be
> compose solely from the attributes of the entity? As in a subset of the
> columns of the table in a third-normalish world. Isn't tacking on
> another column with a concocted id joining the "pervassiveness"?

Not in my opinion. Before cars existed, there was no driver's license
number. The DMV (as it's called in California, anyway) created it, and
it's now a key that they can trust to be unique. It's also an attribute
of the entity now, because it's printed on the cards you hand to people.

The thing that I think is a mistake is to use generated IDs like an
internal implementation detail (i.e. hide them like pointers); then at
the same time mix them into the data model.

Regards,
Jeff Davis

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2011-05-03 21:08:37 Re: postgres segfaulting on pg_restore
Previous Message Rob Sargent 2011-05-03 19:35:28 Re: pervasiveness of surrogate (also called synthetic) keys