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 "Bernt M. Johnsen (JIRA)" <ji...@apache.org> on 2006/12/12 11:05:22 UTC

[jira] Updated: (DERBY-2167) Slightly misleading error message for UNIQUE constraint without NOT NULL constraint

     [ http://issues.apache.org/jira/browse/DERBY-2167?page=all ]

Bernt M. Johnsen updated DERBY-2167:
------------------------------------

    Summary: Slightly misleading error message for UNIQUE constraint without NOT NULL constraint  (was: Slightly misleading error message for UNIQUE constraint without NUT NULL constraint)

> Slightly misleading error message for UNIQUE constraint without NOT NULL constraint
> -----------------------------------------------------------------------------------
>
>                 Key: DERBY-2167
>                 URL: http://issues.apache.org/jira/browse/DERBY-2167
>             Project: Derby
>          Issue Type: Bug
>          Components: Miscellaneous
>            Reporter: Bernt M. Johnsen
>            Priority: Trivial
>
> With UNIQUE contraint, you get an error message which indicates you also need explicit NOT NULL constraint for PRIMARY KEY constraint, which is not true . NOT NULL is implicit for PRIMARY KEY (or more precise according to the lingo in the SQL standard: PRIMARY KEY is an alternative syntax for UNIQUE NOT NULL)
> ij> create table t1 (i integer unique);
> ERROR 42831: 'I' cannot be a column of a primary key or unique key because it can contain null values.
> ij> create table t2 (i integer unique not null);
> 0 rows inserted/updated/deleted
> ij> create table t3 (i integer primary key);
> 0 rows inserted/updated/deleted
> ij> create table t4 (i integer primary key not null);
> 0 rows inserted/updated/deleted

-- 
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