Re: Surrogate VS natural keys

Поиск
Список
Период
Сортировка
От Richard Broersma Jr
Тема Re: Surrogate VS natural keys
Дата
Msg-id 507851.1047.qm@web31806.mail.mud.yahoo.com
обсуждение исходный текст
Ответ на Re: Surrogate VS natural keys  ("Joshua D. Drake" <jd@commandprompt.com>)
Ответы Re: Surrogate VS natural keys  ("Joshua D. Drake" <jd@commandprompt.com>)
Re: Surrogate VS natural keys  ("Merlin Moncure" <mmoncure@gmail.com>)
Список pgsql-general
--- "Joshua D. Drake" <jd@commandprompt.com> wrote:
> The value of a surrogate key is easy retrieval and really has nothing to
> do with normalization or proper modeling.
>
> I often add a surrogate key, even when one is not required just so I
> don't have to worry about have a 4 element where clause.


I've often wondered about this.  Since PostgreSQL allows FOREIGN KEYS to be referenced from UNIQUE
(non-primary) natural keys, couldn't the schema be designed so that every table has a surrogate
PRIMARY KEY and yet still maintain the relationships using UNIQUE natural keys.

Would a design like this be practical?

Regards,
Richard Broersma Jr.

В списке pgsql-general по дате отправления:

Предыдущее
От: Rich Shepard
Дата:
Сообщение: Re: Surrogate VS natural keys
Следующее
От: "Joshua D. Drake"
Дата:
Сообщение: Re: Surrogate VS natural keys