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.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 10.2.1.6
    • None
    • SQL
    • Normal
    • 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
          Richard N. Hillegas

        Issue Links

          Activity

            People

              Unassigned Unassigned
              djd Daniel John Debrunner
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated: