Derby
  1. Derby
  2. DERBY-991

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

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Minor 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'.

      1. w.sql
        0.4 kB
        Rick Hillegas

        Issue Links

          Activity

          Daniel John Debrunner created issue -
          Mike Matrigali made changes -
          Field Original Value New Value
          Component/s SQL [ 11408 ]
          Rick Hillegas made changes -
          Attachment w.sql [ 12414120 ]
          Rick Hillegas made changes -
          Urgency Normal
          Issue & fix info [Newcomer, Repro attached]
          Knut Anders Hatlen made changes -
          Link This issue relates to DERBY-3300 [ DERBY-3300 ]
          Knut Anders Hatlen made changes -
          Link This issue is related to DERBY-789 [ DERBY-789 ]
          Kathey Marsden made changes -
          Labels derby_triage10_5_2
          Gavin made changes -
          Workflow jira [ 12347092 ] Default workflow, editable Closed status [ 12799558 ]

            People

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

              Dates

              • Created:
                Updated:

                Development