You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Rick Hillegas (JIRA)" <de...@db.apache.org> on 2005/10/27 17:59:55 UTC

[jira] Closed: (DERBY-653) Allow unique constraints to pass if one of the columns is null

     [ 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