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

From: David Pradier <david(dot)pradier(at)clarisys(dot)fr>
To: pgsql-general(at)postgresql(dot)org
Subject: Is a primary key made of a couple columns so much better than a unique() constraint ?
Date: 2005-10-10 14:44:54
Message-ID: 20051010144454.GA11256@clarisys.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Scott Marlowe 2005-10-10 14:51:48 Re: PostgreSQL 8.1 vs. MySQL 5.0?
Previous Message Greg Sabino Mullane 2005-10-10 14:30:21 Re: Oracle buys Innobase