Uploaded image for project: 'Derby'
  1. Derby
  2. DERBY-991

Defining the same primary key twice on a table actually attempts to create two constraints.

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 10.2.1.6
    • Fix Version/s: None
    • Component/s: SQL
    • Urgency:
      Normal
    • Issue & fix info:
      Newcomer, Repro attached

      Description

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

        Attachments

        1. w.sql
          0.4 kB
          Rick Hillegas

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                djd Daniel John Debrunner
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated: