Is a primary key made of a couple columns so much better than a unique() constraint ?

Поиск
Список
Период
Сортировка
От David Pradier
Тема Is a primary key made of a couple columns so much better than a unique() constraint ?
Дата
Msg-id 20051010144454.GA11256@clarisys.fr
обсуждение исходный текст
Ответы Re: Is a primary key made of a couple columns so much better than a unique() constraint ?  (Martijn van Oosterhout <kleptog@svana.org>)
Список pgsql-general
Hi everybody,

i'd like to know if it is better to use a primary key made of a couple
columns, than to use a constraint UNIQUE() on this couple columns,
regarding the sake of postgresql.

For example, i've got these two tables, 'buyer' and 'purchaser' and i
want to make an association table buyer_purchaser in which i get only
some couples (id_buyer, id_purchaser), with a unique() contraint on them.

If i put a primary key on the couple, i won't use it, because the
framework on top of it is unable to use a primary key made of a couple of
columns.
Si my question is : is it better, in so far as only the database is
concerned, to have a primary key than a unique() contraint on a couple
columns ?

Thanks in advance for your answers,
David

--
David Pradier -- Directeur Technique de Clarisys Informatique -- Chef de projet logiciels libres / open-source

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

Предыдущее
От: "Greg Sabino Mullane"
Дата:
Сообщение: Re: Oracle buys Innobase
Следующее
От: Scott Marlowe
Дата:
Сообщение: Re: PostgreSQL 8.1 vs. MySQL 5.0?