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:33:22
Message-ID: 1114612401.13303.1283.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.

Actually, considering that many databases (at least in the past) have
ignored this and treated nulls as unique things, it's quite
understandable.

MSSQL, for instance, used to definitely allow only one null in a unique
field. So, for that database, not null wasn't really necessary for a
primary key column.

I believe this problem exist(s)(ed) in several other supposedly
"enterprise" class databases as well.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Stephane Bortzmeyer 2005-04-27 14:36:49 Re: PRIMARY KEY on a *group* of columns imply that each column is NOT
Previous Message Tom Lane 2005-04-27 14:26:30 Re: PRIMARY KEY on a *group* of columns imply that each column is NOT