X-Original-To: pgsql-admin@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 22D44475F6A for ; Tue, 8 Apr 2003 14:13:34 -0400 (EDT) Received: from web13310.mail.yahoo.com (web13310.mail.yahoo.com [216.136.173.222]) by postgresql.org (Postfix) with SMTP id 31CB3475EC9 for ; Tue, 8 Apr 2003 14:13:33 -0400 (EDT) Message-ID: <20030408181332.49933.qmail@web13310.mail.yahoo.com> Received: from [67.95.85.164] by web13310.mail.yahoo.com via HTTP; Tue, 08 Apr 2003 11:13:32 PDT Date: Tue, 8 Apr 2003 11:13:32 -0700 (PDT) From: P G Subject: How does PostgreSQL treat null values in unique composite constraints??? To: pgsql-admin@postgresql.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Status: No, hits=-5.8 required=5.0 tests=BAYES_10 version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200304/104 X-Sequence-Number: 8259 I have the following table with a unique constraint. create table testt ( id int, aa int, bb int, constraint pk_testt primary key (id), constraint cons_testt unique (aa,bb)); Let's say I insert the following: insert into testt values (1,2,null); insert into testt values (2,2,null); I thought this should fail because of the unique constraint, but it doesn't. How does PostgreSQL view the null values in this constraint? Will someone explain why I am allowed to make this insertion? TIA. __________________________________________________ Do you Yahoo!? Yahoo! Tax Center - File online, calculators, forms, and more http://tax.yahoo.com