db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Øystein Grøvlen (JIRA) <j...@apache.org>
Subject [jira] Commented: (DERBY-2212) Add "Unique where not null" to create index
Date Wed, 31 Oct 2007 11:21:50 GMT

    [ https://issues.apache.org/jira/browse/DERBY-2212?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12539050

Øystein Grøvlen commented on DERBY-2212:

Thanks for the new version of the func spec, Anurag.

In this version you do not mention anything about 'CREATE UNIQUE INDEX'.  I guess that means
that you propose to keep the existing behavior, and not introduce a new syntax to match the
behavior of unique constraints for nullable columns.   I think it would be good if that was
stated explicitly in the func spec, and you should also explain why you think a new CREATE
INDEX is not necessary. (And if this is no longer about CREATE INDEX, maybe this func spec
is attached to the wrong issue?)

Under 'Hard Upgrade' you write: 'No update will be required as this won't change the existing
behavior'.  I am not quite sure what that is supposed to mean.  Do you mean that a user will
not have to make any changes to her applications after a hard upgrade?  And what do you mean
by 'existing behavior'?  That constraints defined as 'UNIQUE NOT NULL' will work as before?
 I think it need to be defined what is meant by "existing behavior".

Another issue that is not clear to me, is the implications of changing the nullability of
a column with ALTER TABLE .  It should probably be discussed how that will be affected by
this work.

> Add "Unique where not null" to create index
> -------------------------------------------
>                 Key: DERBY-2212
>                 URL: https://issues.apache.org/jira/browse/DERBY-2212
>             Project: Derby
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions:
>            Reporter: Oleksandr Alesinskyy
>            Assignee: Anurag Shekhar
>         Attachments: derby-2212preview.diff, derby-2212preview2.diff, FunctionalSpec.html,
> Derby prohibits creation of unique constraints on nullable colums (as well if only some
columns in the constraint list are nullable) and treat nulls in unique indexes as normal values
(i.e. only one row with null values in indexed columns may be inserted into the table). This
bahavior is very restrictive, does not completely comply with SQL standards (both letter and
intent) as well as with business needs and intending meaning of NULL values (2 null values
are not considered as equal, this comparision shall return NULL, and for selection criteria
boolean null is treated as FALSE).
> This behavior, as far as I can see, is modelled after DB2 (and differs from behavior
of most other major databases, like SyBase, Oracle, etc.).
> But even DB2 provide some means to alleviate these restrictions, namely "UNIQUE WHERE
NOT NULL" clause for CREATE INDEX statement.
> It will be very good if such "UNIQUE WHERE NOT NULL" clause will be introduced in Derby.
> Regards,
> Oleksandr Alesinskyy

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message