X-Original-To: pgsql-admin@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id E207C4762D7 for ; Tue, 8 Apr 2003 16:41:18 -0400 (EDT) Received: from megazone.bigpanda.com (megazone.bigpanda.com [63.150.15.178]) by postgresql.org (Postfix) with ESMTP id 6D80A47622E for ; Tue, 8 Apr 2003 16:41:18 -0400 (EDT) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id C515AD656; Tue, 8 Apr 2003 13:41:19 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id BAC315C0B; Tue, 8 Apr 2003 13:41:19 -0700 (PDT) Date: Tue, 8 Apr 2003 13:41:19 -0700 (PDT) From: Stephan Szabo To: P G Cc: Subject: Re: How does PostgreSQL treat null values in unique composite In-Reply-To: <20030408194858.77038.qmail@web13306.mail.yahoo.com> Message-ID: <20030408133754.J54456-100000@megazone23.bigpanda.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Status: No, hits=-16.7 required=5.0 tests=BAYES_00,EMAIL_ATTRIBUTION,IN_REP_TO,QUOTE_TWICE_1 autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200304/120 X-Sequence-Number: 8275 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.