Re: PRIMARY KEYS - Mailing list pgsql-general

From Martijn van Oosterhout
Subject Re: PRIMARY KEYS
Date
Msg-id 20030521052440.GD18900@svana.org
Whole thread Raw
In response to Re: PRIMARY KEYS  (Mark Wilson <mwilson13@cox.net>)
List 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@svana.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

Attachment

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Subqueries and the optimizer
Next
From: Jean-Christian Imbeault
Date:
Subject: SELECT DISTINCT ON bug?