Re: PRIMARY KEYS

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Mark Wilson <mwilson13(at)cox(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: PRIMARY KEYS
Date: 2003-05-21 05:24:42
Message-ID: 20030521052440.GD18900@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, May 20, 2003 at 03:50:11PM -0400, Mark Wilson wrote:
> Another reason to create a primary key would be to avoid overly complex
> composite keys, particularly those that require attributes that are not
> otherwise important for the data model -- for example, an adult could
> be uniquely identified by a composite key including name, date of
> birth, place of birth, parent's names, etc., without using the National
> Insurance number (or some other formerly created key).

The other problem is that not everyone may have a National Insurance number
(maybe they're foreigners or not old enough). Using identifiers that you
don't control is a risky business (wasn't there something about US Social
Security Numbers not being unique?).

At least in Australia, the National Privacy Principles state, among other
things, that you are not allowed to use as primary identifier for a customer
an identifier assigned by other organisation (except in certain special
circumstances). So, using something like your Tax File Number, Medicare
Number or Drivers Licence number as primary key is forbidden. If you're
permitted to have the information you're allowed to store it but you sure as
hell can't index your filing cabinets on it or make it a primary key.

--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> "the West won the world not by the superiority of its ideas or values or
> religion but rather by its superiority in applying organized violence.
> Westerners often forget this fact, non-Westerners never do."
> - Samuel P. Huntington

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jean-Christian Imbeault 2003-05-21 06:35:37 SELECT DISTINCT ON bug?
Previous Message Tom Lane 2003-05-21 03:48:47 Re: Subqueries and the optimizer