Re: extensible enum types

Поиск
Список
Период
Сортировка
От Kevin Grittner
Тема Re: extensible enum types
Дата
Msg-id 4C1DEC62020000250003264D@gw.wicourts.gov
обсуждение исходный текст
Ответ на extensible enum types  (Andrew Dunstan <andrew@dunslane.net>)
Ответы Re: extensible enum types  (Peter Geoghegan <peter.geoghegan86@gmail.com>)
Список pgsql-hackers
Peter Geoghegan  wrote:
> How many lookup tables have you seen in the wild with a natural
> key?
Me?  Personally?  A few hundred.

> People sometimes represent things like US states as enums. This is
> probably a mistake, because you cannot control or predict if
> there'll be a new US state, unlikely though that me be.
More importantly, you're likely to need to associate properties with
the state.  Sales tax info, maybe a sales manager, etc.  A state
table can be a handy place to store things like that.
> I don't like the idea of having values in a table that aren't so
> much data as an integral part of your application/database.
Yep, exactly why natural keys should be used when possible.
-Kevin



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

Предыдущее
От: Peter Geoghegan
Дата:
Сообщение: Re: extensible enum types
Следующее
От: Tom Lane
Дата:
Сообщение: Re: beta3 & the open items list