Skip site navigation (1) Skip section navigation (2)

Re: NULL values seem to short-circuit my unique index

From: Chris <dmagick(at)gmail(dot)com>
To: Matthew Wilson <matt(at)tplus1(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: NULL values seem to short-circuit my unique index
Date: 2008-09-29 02:59:59
Message-ID: 48E044AF.9040104@gmail.com (view raw or flat)
Thread:
Lists: pgsql-general
Matthew Wilson wrote:
> I'm trying to comprehend how NULL values interact with unique indexes.
> It seems like I can insert two rows with NULL values in a column with a
> unique constraint just fine.
> 
> Is there something special about NULL?  Can anyone post some links to
> explain what is going on?

When you think of null as "unknown", it makes sense.

Does an unknown value equal another unknown value?

http://www.postgresql.org/docs/8.3/interactive/functions-logical.html

http://www.postgresql.org/docs/8.3/interactive/functions-comparison.html

-- 
Postgresql & php tutorials
http://www.designmagick.com/


In response to

Responses

pgsql-general by date

Next:From: Tom LaneDate: 2008-09-29 03:04:50
Subject: Re: NULL values seem to short-circuit my unique index
Previous:From: Matthew WilsonDate: 2008-09-29 02:32:56
Subject: NULL values seem to short-circuit my unique index

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group