Re: are primary keys always 'needed'

Поиск
Список
Период
Сортировка
Искать
От
Tom Lane
Тема
Re: are primary keys always 'needed'
Дата
Msg-id
9886.1267376682@sss.pgh.pa.us
Ответ на
Список
Дерево обсуждения
Re: are primary keys always 'needed' Jasen Betts <jasen@xnet.co.nz>
Serge Fonville  writes:
> Some have a serial that is used as a foreign key in another table.
> Some tables consist of a combination of two foreign keys (that are
> unique together) and a field that is uniquely related to that
> combination (but is not necessarily unique within the table)

BTW, I forgot to mention that it's perfectly reasonable to have a
multi-column primary key, which is what seems to be indicated in
this type of example.  I wouldn't advocate making up a surrogate
primary key in a linking table, if the combination of its foreign
keys can do the job.

			regards, tom lane
В списке pgsql-novice по дате отправления
От: Tom Lane
Дата:
От: Serge Fonville
Дата:
FAQ