[ 
https://issues.apache.org/jira/browse/NETBEANS-624?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16658246#comment-16658246
 ] 

Alexander Romanenko commented on NETBEANS-624:
----------------------------------------------

Going through this in NetCat 10

What syntax error did you get.

I am wondering if this is OK behavior, because one cannot logically have a 
unique column that has a default value, as it will imply the table user is 
allowed to omit values of that column letting the database use Default value, 
causing multiple rows to have this default value, thus violating Unique 
constraint.

Same for Null vs Not Null. if columns are allowed to be left without value at 
all, they are not going to be unique.

 

Interestingly, PostgreSQL that I am testing this on allows for this logical 
faults during creation, but then no INSERT query works causing essentially 
broken table. Your engine seems to be smarter about this.  Perhaps a proposed 
solution could be to have the UI be aware of logical inconsistency - eg. 
disable unique checkbox if default is not empty, vice versa, etc.

> Can not create "Unique" column in table with Derby database
> -----------------------------------------------------------
>
>                 Key: NETBEANS-624
>                 URL: https://issues.apache.org/jira/browse/NETBEANS-624
>             Project: NetBeans
>          Issue Type: Bug
>          Components: db - DB schema
>    Affects Versions: 9.0
>            Reporter: Vldimir Orlyansky
>            Priority: Minor
>
> Found in NetCat 9.0
> Can not create column with "Unique" constraint.
> I try to create column with Unique. If select only Unique constraint i need 
> to add Default. If set any default i have syntax error on creation.
> If i select "Null" constraint result index does not have "Unique" property.
> In "Indexes" node new unique index can be created without problem.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to