Re: IS it a good practice to use SERIAL as Primary Key?

Поиск
Список
Период
Сортировка
От Jim Nasby
Тема Re: IS it a good practice to use SERIAL as Primary Key?
Дата
Msg-id E90A59E4-8BD2-4E1A-A4BD-29ADA695A344@decibel.org
обсуждение исходный текст
Ответ на Re: IS it a good practice to use SERIAL as Primary Key?  (Ron Johnson <ron.l.johnson@cox.net>)
Список pgsql-general
On Nov 23, 2006, at 10:23 AM, Ron Johnson wrote:
> I'm one of those who thinks that a (possibly multisegment) natural
> key *does* exist, and that if you think it doesn't, your design is
> wrong.

I agree, but that doesn't mean you want to be spreading that multi-
field key throughout your database. For example, origination,
destination, flight_number, and date together make a unique key for a
segment of a flight. But that doesn't mean you want to be storing all
that info in every other table in the database that references a
segment. Not only does moving all that data around become non-
trivial, writing all that stuff into all the joins is error-prone
(not to mention a PITA).
--
Jim Nasby                                            jim@nasby.net
EnterpriseDB      http://enterprisedb.com      512.569.9461 (cell)



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

Предыдущее
От: Scott Ribe
Дата:
Сообщение: Re: NULLs ;-)
Следующее
От: "Harald Armin Massa"
Дата:
Сообщение: Re: PostgreSQL doesn't accept connections when Windows