Re: are primary keys always 'needed'
| От | Tom Lane |
|---|---|
| Тема | Re: are primary keys always 'needed' |
| Дата | |
| Msg-id | 9886.1267376682@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | are primary keys always 'needed' (Serge Fonville <serge.fonville@gmail.com>) |
| Ответы |
Re: are primary keys always 'needed'
|
| Список | pgsql-novice |
Serge Fonville <serge.fonville@gmail.com> 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 по дате отправления: