Re: PRIMARY KEYS
От | Martijn van Oosterhout |
---|---|
Тема | Re: PRIMARY KEYS |
Дата | |
Msg-id | 20030521052440.GD18900@svana.org обсуждение исходный текст |
Ответ на | Re: PRIMARY KEYS (Mark Wilson <mwilson13@cox.net>) |
Список | 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
Вложения
В списке pgsql-general по дате отправления: