Re: Unique Index - Mailing list pgsql-general

From Stephan Szabo
Subject Re: Unique Index
Date
Msg-id 20050119071649.H54178@megazone.bigpanda.com
Whole thread Raw
In response to Unique Index  (Alex <alex@meerkatsoft.com>)
List pgsql-general
On Thu, 20 Jan 2005, Alex wrote:

> i have a unique index on a table over multiple columns. If now one of
> the records has a null value in one of the indexed columns i can insert
> the same record multiple times.
>
> Is this a problem within postgres or expected?

Expected. NULLs are effectively not considered as the same for the
purposes of UNIQUE.

The predicate basically functions as:

2) If there are no two rows in T such that the value of each column
in one row is non-null and is equal to the value of the cor-
responding column in the other row according to Subclause 8.2,
"<comparison predicate>", then the result of the <unique predi-
cate> is true; otherwise, the result of the <unique predicate>
is false.

pgsql-general by date:

Previous
From: Michael Garriss
Date:
Subject: Need help recovering
Next
From: Roman Neuhauser
Date:
Subject: Re: Infinite recursion detected... How do I prevent that?