Re: How does PostgreSQL treat null values in unique composite - Mailing list pgsql-admin

From Stephan Szabo
Subject Re: How does PostgreSQL treat null values in unique composite
Date
Msg-id 20030408133754.J54456-100000@megazone23.bigpanda.com
Whole thread Raw
In response to Re: How does PostgreSQL treat null values in unique composite  (P G <pg_dba@yahoo.com>)
List pgsql-admin
On Tue, 8 Apr 2003, P G wrote:

> > Where can I find the documentation cited for the
> > "unique predicate" mentioned below?
That's the SQL92 draft, although I believe the SQL99 text is effectively
the same.  The sections are 11.7 (for the definition of the constraint
in terms of the predicate) and 8.9 for the predicate itself (General Rule
2 specifically)

> Also, the "unique predicate" only explains what it
> means to be unique, but it says nothing about how null
> values are treated.  Will someone explain what the
> value of null is?

It isn't a precise value.  It's a holder for unknown.  It's unknown
whether it's equal or not equal to any other value (including another
NULL), so 1 = NULL returns unknown, NULL=NULL returns unknown, 1!=NULL
returns unknown.


pgsql-admin by date:

Previous
From: Jeff Boes
Date:
Subject: Re: pg_class.reltuples not reset by VACUUM?
Next
From: Bill Hilburn
Date:
Subject: urgent, Table not shown but files are there.