Re: 2 versions of an entity worth distinct table?

Поиск
Список
Период
Сортировка
От Chris Browne
Тема Re: 2 versions of an entity worth distinct table?
Дата
Msg-id 871v4z2hob.fsf@cbbrowne.afilias-int.info
обсуждение исходный текст
Ответ на 2 versions of an entity worth distinct table?  (gvim <gvimrc@gmail.com>)
Список pgsql-general
gvimrc@gmail.com (gvim) writes:
> If a table representing contact details can have 2 but no more than 2 email addresses is it really worth
factoring-outemail addresses to a separate table. Technically it's a 1-to-many relationship so should be done this way
butwhat is the general practice out there in such "max. 2" situations? Keeping them as: 
>
> Primary Email
> Secondary Email
>
> .... also preserves priority though not strictly normalised, I know.

I'd be inclined to normalize this, as it's:

a) difficult to guarantee that it will only ever be 2.

b) mighty nice to be able to attach validation rules to ONE simple email
   table, rather than having to put them on several columns possibly
   spread across more tables.
--
wm(X,Y):-write(X),write('@'),write(Y). wm('cbbrowne','gmail.com').
http://linuxfinances.info/info/internet.html
If nothing ever sticks to Teflon, how do they make Teflon stick to the
pan?

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: query stuck at SOCK_wait_for_ready function call
Следующее
От: Chris Browne
Дата:
Сообщение: Re: Standard schemas for common features?