Re: Primary Key

Поиск
Список
Период
Сортировка
От Sam Mason
Тема Re: Primary Key
Дата
Msg-id 20071123114904.GR1955@frubble.xen.chris-lamb.co.uk
обсуждение исходный текст
Ответ на Re: Primary Key  (Csaba Nagy <nagy@ecircle-ag.com>)
Список 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 по дате отправления:

Предыдущее
От: Dragan Zubac
Дата:
Сообщение: Transaction question
Следующее
От: "Thomas Chille"
Дата:
Сообщение: autovacuum process blocks without reporting a deadlock