Re: PRIMARY KEY on a *group* of columns imply that each column is NOT

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Stephane Bortzmeyer <bortzmeyer(at)nic(dot)fr>
Cc: Scott Marlowe <smarlowe(at)g2switchworks(dot)com>, Guy Rouillier <guyr(at)masergy(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: PRIMARY KEY on a *group* of columns imply that each column is NOT
Date: 2005-04-27 14:26:30
Message-ID: 21937.1114611990@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Stephane Bortzmeyer <bortzmeyer(at)nic(dot)fr> writes:
> Yes, PostgreSQL is right and implement the standard. Now, what's the
> rationale for the standard? I understand it for a single column but,
> for several columns, it should be still possible to have different
> tuples, such as (3, NULL) and (5, NULL) for instance.

If that's what you want, declare it as UNIQUE not PRIMARY KEY.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Scott Marlowe 2005-04-27 14:33:22 Re: PRIMARY KEY on a *group* of columns imply that each
Previous Message Stephane Bortzmeyer 2005-04-27 14:06:32 Re: PRIMARY KEY on a *group* of columns imply that each column is NOT