Re: How does PostgreSQL treat null values in unique composite

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: P G <pg_dba(at)yahoo(dot)com>
Cc: <pgsql-admin(at)postgresql(dot)org>
Subject: Re: How does PostgreSQL treat null values in unique composite
Date: 2003-04-08 20:41:19
Message-ID: 20030408133754.J54456-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Bill Hilburn 2003-04-08 20:59:26 urgent, Table not shown but files are there.
Previous Message Jeff Boes 2003-04-08 20:30:01 Re: pg_class.reltuples not reset by VACUUM?