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

From: Scott Marlowe <smarlowe(at)g2switchworks(dot)com>
To: Stephane Bortzmeyer <bortzmeyer(at)nic(dot)fr>
Cc: Patrick TJ McPhee <ptjm(at)interlog(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: PRIMARY KEY on a *group* of columns imply that each
Date: 2005-04-27 14:36:57
Message-ID: 1114612616.13303.1285.camel@state.g2switchworks.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, 2005-04-27 at 09:06, Stephane Bortzmeyer wrote:
> On Wed, Apr 27, 2005 at 05:19:32AM +0000,
> Patrick TJ McPhee <ptjm(at)interlog(dot)com> wrote
> a message of 37 lines which said:
>
> > but you should know that in SQL, unique constraints don't apply to
> > rows containing null values
>
> May be I should but I didn't.
>
> > your table definition will be as you want it, but the constraint you
> > want won't be there.
>
> OK, I will try to write a custom trigger, then.

Often the best bet here, btw, is to declare it not null then use
something other than null to represent null, like the text characters NA
or something.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message mmiranda 2005-04-27 14:45:44 After insert trigger question
Previous Message Stephane Bortzmeyer 2005-04-27 14:36:49 Re: PRIMARY KEY on a *group* of columns imply that each column is NOT