Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 801 invoked from network); 27 Oct 2005 16:00:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 27 Oct 2005 16:00:20 -0000 Received: (qmail 65649 invoked by uid 500); 27 Oct 2005 16:00:18 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 65616 invoked by uid 500); 27 Oct 2005 16:00:18 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 65607 invoked by uid 99); 27 Oct 2005 16:00:18 -0000 X-ASF-Spam-Status: No, hits=1.3 required=10.0 tests=SPF_FAIL X-Spam-Check-By: apache.org Received: from [192.87.106.226] (HELO ajax.apache.org) (192.87.106.226) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Oct 2005 09:00:17 -0700 Received: from ajax.apache.org (ajax.apache.org [127.0.0.1]) by ajax.apache.org (Postfix) with ESMTP id E953321F for ; Thu, 27 Oct 2005 17:59:55 +0200 (CEST) Message-ID: <1736594826.1130428795953.JavaMail.jira@ajax.apache.org> Date: Thu, 27 Oct 2005 17:59:55 +0200 (CEST) From: "Rick Hillegas (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Closed: (DERBY-653) Allow unique constraints to pass if one of the columns is null In-Reply-To: <711186159.1130372515539.JavaMail.jira@ajax.apache.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/DERBY-653?page=all ] Rick Hillegas closed DERBY-653: ------------------------------- Resolution: Invalid Derby, like DB2, finesses this issue by not allowing nullable columns in unique constraints. > Allow unique constraints to pass if one of the columns is null > -------------------------------------------------------------- > > Key: DERBY-653 > URL: http://issues.apache.org/jira/browse/DERBY-653 > Project: Derby > Type: Bug > Components: SQL > Reporter: Rick Hillegas > > This appears to be the behavior required by ansi. This issue was raised by Dan Meany on the user list in a thread titled "Unique constraints on multiple fields with one nullable" on October 26, 2005. Sybase and Postgres allow this behavior. DB2 finesses the issue by not allowing you to declare a unique constraint on nullable columns. Here is Dan's post: > I noticed that in Derby a unique constraint on two > columns A and B, with B nullable, will prevent > inserting two identical records that contain NULL in > B. > This is different from some other databases such as > Sybase that do allow it (I assume where the null > records are not in stored as part of the unique > index). > I noticed this while transfering data from Sybase to > Derby using Apache dbutils and getting rejected > duplicate records. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira