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 "Knut Anders Hatlen (JIRA)" <ji...@apache.org> on 2010/03/02 21:05:27 UTC

[jira] Commented: (DERBY-991) Defining the same primary key twice on a table actually attempts to create two constraints.

    [ https://issues.apache.org/jira/browse/DERBY-991?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12840305#action_12840305 ] 

Knut Anders Hatlen commented on DERBY-991:
------------------------------------------

No need to file a new JIRA issue for (2), as it's already tracked in DERBY-789.

> Defining the same  primary key twice on a table actually attempts to create two constraints.
> --------------------------------------------------------------------------------------------
>
>                 Key: DERBY-991
>                 URL: https://issues.apache.org/jira/browse/DERBY-991
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.2.1.6
>            Reporter: Daniel John Debrunner
>            Priority: Minor
>         Attachments: w.sql
>
>
> Defining the same  primary key twice on a table actually attempts to create two constraints.
> ij> create table t ( i int, b int,  primary key (i,b), primary key (i,b));
> ERROR 42Z93: Constraints 'SQL060215062628851' and 'SQL060215062628850' have the
> same set of columns, which is not allowed.
> ij> create table t ( i int primary key primary key primary key);
> ERROR 42Z93: Constraints 'SQL060214082337951' and 'SQL060214082337950' have the
> same set of columns, which is not allowed.
> Other combinations of two primary keys (that I could think of) return the correct error.
> ij> create table t ( i int, b int,  primary key (i,b), primary key (b));
> ERROR 42X90: More than one primary key constraint specified for table 'T'.
> ij> create table t ( i int primary key, b int primary key);
> ERROR 42X90: More than one primary key constraint specified for table 'T'.

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