Re: Primary Key - Mailing list pgsql-general

From Sam Mason
Subject Re: Primary Key
Date
Msg-id 20071123114904.GR1955@frubble.xen.chris-lamb.co.uk
Whole thread Raw
In response to Re: Primary Key  (Csaba Nagy <nagy@ecircle-ag.com>)
List pgsql-general
On Fri, Nov 23, 2007 at 12:00:18PM +0100, Csaba Nagy wrote:
> I'm not sure how it is in the US, but here in Germany I just reused a
> car plate from the owner it had before me... so now the plate is
> uniquely associated at most with the car, not the owner... and I'm
> pretty sure that's not unique either.
>
> And what do you do when the things shift meaning in your natural key ?
> Cause that's a very common thing to happen to natural keys. And suddenly
> what was unique becomes not unique anymore... and the headaches begin...
>
> You're better off using synthetic keys for references between tables,
> and you can still keep your natural keys for lookup, just don't use them
> as unique join criteria, only search/filter criteria.

To me, that just confirms that using natural keys for tracking data
outside the database is wrong.  For the abstractions inside the database
natural keys make a lot of sense.


  Sam

pgsql-general by date:

Previous
From: Dragan Zubac
Date:
Subject: Transaction question
Next
From: "Thomas Chille"
Date:
Subject: autovacuum process blocks without reporting a deadlock