db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rick Hillegas (JIRA)" <derby-...@db.apache.org>
Subject [jira] Created: (DERBY-653) Allow unique constraints to pass if one of the columns is null
Date Thu, 27 Oct 2005 00:21:55 GMT
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


Mime
View raw message