Is a primary key made of a couple columns so much better than a unique() constraint ? - Mailing list pgsql-general

From David Pradier
Subject Is a primary key made of a couple columns so much better than a unique() constraint ?
Date
Msg-id 20051010144454.GA11256@clarisys.fr
Whole thread Raw
Responses Re: Is a primary key made of a couple columns so much better than a unique() constraint ?
List 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 by date:

Previous
From: "Greg Sabino Mullane"
Date:
Subject: Re: Oracle buys Innobase
Next
From: Scott Marlowe
Date:
Subject: Re: PostgreSQL 8.1 vs. MySQL 5.0?