Derby
  1. Derby
  2. DERBY-789

Usability issue: "Constraints have the same set of columns"

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: SQL
    • Urgency:
      Low

      Description

      Legolas Woodland reported on derby-user that derby return errors like :
      org.apache.derby.client.am.SqlException: Constraints
      'SQL060103004635123' and 'SQL060103004635121' have the same set of
      columns, which is not allowed.

      He got this when creating a table like this:
      create table WEBSITES (USERID integer not null unique, WEBSITEID
      bigint not null unique, DOMAINNAME varchar(255) not null unique,
      DESCRIPTION varchar(255), PPVIEW double, PPCLICK double, PPWEEK
      double, totalClick bigint, totalView bigint, active smallint, primary
      key (WEBSITEID));

      Omitting the unique specifier made things work.

      I think this is a usability issue. At least, one should not present names to the user, that has been generated internally. Instead, it would be helpful if the names of the columns involved was mentioned. I see two ways to solve this:

      1. Return error that says that duplicate contraints on the following columns are not allowed.
      2. Allow this and use same index for both constraints. (I guess dropping constraints will be more complicated in this case since one will have to check if other constraints are using the same index.)

        Issue Links

          Activity

          Øystein Grøvlen created issue -
          Øystein Grøvlen made changes -
          Field Original Value New Value
          Description Legolas Woodland reported on derby-user that derby return errors like :
          org.apache.derby.client.am.SqlException: Constraints
          'SQL060103004635123' and 'SQL060103004635121' have the same set of
          columns, which is not allowed.

          He got this when creating a table like this:
          create table WEBSITES (USERID integer not null unique, WEBSITEID
          bigint not null unique, DOMAINNAME varchar(255) not null unique,
          DESCRIPTION varchar(255), PPVIEW double, PPCLICK double, PPWEEK
          double, totalClick bigint, totalView bigint, active smallint, primary
          key (WEBSITEID));

          Omitting the unique specifier made things work.

          I think this is a usability issue. At least, one should not present boject names to the user, that has been generated internally. Instead, it would be helpful if the names of the columns involved was mentioned. I see two ways to solve this:

          1. Return error that says that duplicate contraints on the following columns are not allowed.
          2. Allow this and use same index for both constraints. (I guess dropping constraints will be more complicated in this case since one will have to check if other constraints are using the same index.)
          Legolas Woodland reported on derby-user that derby return errors like :
          org.apache.derby.client.am.SqlException: Constraints
          'SQL060103004635123' and 'SQL060103004635121' have the same set of
          columns, which is not allowed.

          He got this when creating a table like this:
          create table WEBSITES (USERID integer not null unique, WEBSITEID
          bigint not null unique, DOMAINNAME varchar(255) not null unique,
          DESCRIPTION varchar(255), PPVIEW double, PPCLICK double, PPWEEK
          double, totalClick bigint, totalView bigint, active smallint, primary
          key (WEBSITEID));

          Omitting the unique specifier made things work.

          I think this is a usability issue. At least, one should not present names to the user, that has been generated internally. Instead, it would be helpful if the names of the columns involved was mentioned. I see two ways to solve this:

          1. Return error that says that duplicate contraints on the following columns are not allowed.
          2. Allow this and use same index for both constraints. (I guess dropping constraints will be more complicated in this case since one will have to check if other constraints are using the same index.)
          Bryan Pendleton made changes -
          Assignee Bryan Pendleton [ bryanpendleton ]
          Bryan Pendleton made changes -
          Attachment PrimaryImpliesUnique.diff [ 12437620 ]
          Knut Anders Hatlen made changes -
          Link This issue relates to DERBY-991 [ DERBY-991 ]
          Knut Anders Hatlen made changes -
          Link This issue relates to DERBY-3300 [ DERBY-3300 ]
          Mamta A. Satoor made changes -
          Labels derby_triage10_11
          Urgency Low [ 10053 ]
          Gavin made changes -
          Workflow jira [ 12345256 ] Default workflow, editable Closed status [ 12801857 ]

            People

            • Assignee:
              Bryan Pendleton
              Reporter:
              Øystein Grøvlen
            • Votes:
              2 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:

                Development