Derby
  1. Derby
  2. DERBY-396

Support for ALTER STATEMENT to DROP , MODIFY, RENAME a COLUMN

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 10.3.1.4
    • Component/s: SQL
    • Labels:
      None
    • Environment:
      LINUX

      Description

      Alter Statement should support dropping a column, modifying a column to a different data type , rename a column.

      1. dropColumn_1.diff
        16 kB
        Bryan Pendleton

        Issue Links

          Activity

          Kumar Matcha created issue -
          Rick Hillegas made changes -
          Field Original Value New Value
          Comment [ ANSI supplies syntax for dropping columns:

            ALTER TABLE tableName DROP COLUMN columnName

          --------------------------


          Derby already supports some changes to datatypes. It would be interesting to understand what other modifications are needed and what their use cases are.

          --------------------------

          I can't find ANSI syntax for renaming a column. I also can't find this feature in DB2. Oracle and Postgres agree on the following syntax:

            ALTER TABLE tableName RENAME COLUMN oldColumnName TO newColumnName

          MySQL supports less intuitive syntax:

            ALTER TABLE tableName CHANGE oldColumnName newColumnName oldDatatype

          Is the Oracle/Postgres agreement a good enough standard for us? ]
          Rick Hillegas made changes -
          Comment [ Dropping a column seems well defined. The ANSI syntax is:

            ALTER TABLE tableName DROP COLUMN columnName

          ------------------------------

          It would be interesting to understand the use cases for datatype modification.

          ------------------------------

          I can't find ANSI syntax for renaming columns. I also can't find this feature in the DB2 reference manual. Oracle and Postgres support the following reasonable syntax:

            ALTER TABLE tableName RENAME COLUMN oldColumnName TO newColumnName

          MySQL supports the same functionality with less intuitive syntax:

            ALTER TABLE tableName CHANGE oldColumnName newColumnName oldColumnDatatype

          Is the Oracle/Postgres agreement good enough for us to declare a standard here?
          ]
          Rick Hillegas made changes -
          Link This issue relates to DERBY-168 [ DERBY-168 ]
          Rick Hillegas made changes -
          Link This issue relates to DERBY-119 [ DERBY-119 ]
          Rick Hillegas made changes -
          Link This issue relates to DERBY-165 [ DERBY-165 ]
          Scott MacDonald made changes -
          Assignee Scott MacDonald [ scottmmd ]
          Andrew McIntyre made changes -
          Priority Blocker [ 1 ] Critical [ 2 ]
          Rick Hillegas made changes -
          Link This issue is cloned as DERBY-726 [ DERBY-726 ]
          Rick Hillegas made changes -
          Priority Critical [ 2 ] Major [ 3 ]
          Rick Hillegas made changes -
          Assignee Scott MacDonald [ scottmmd ]
          Bryan Pendleton made changes -
          Assignee Bryan Pendleton [ bryanpendleton ]
          Bryan Pendleton made changes -
          Attachment dropColumn_1.diff [ 12336346 ]
          Bryan Pendleton made changes -
          Link This issue is related to DERBY-1489 [ DERBY-1489 ]
          Bryan Pendleton made changes -
          Link This issue is related to DERBY-1490 [ DERBY-1490 ]
          Bryan Pendleton made changes -
          Link This issue relates to DERBY-1490 [ DERBY-1490 ]
          Bryan Pendleton made changes -
          Link This issue is related to DERBY-1491 [ DERBY-1491 ]
          Bryan Pendleton made changes -
          Link This issue relates to DERBY-1491 [ DERBY-1491 ]
          Bryan Pendleton made changes -
          Link This issue is related to DERBY-1492 [ DERBY-1492 ]
          Bryan Pendleton made changes -
          Link This issue relates to DERBY-1492 [ DERBY-1492 ]
          Bryan Pendleton made changes -
          Link This issue is related to DERBY-1515 [ DERBY-1515 ]
          Bryan Pendleton made changes -
          Link This issue relates to DERBY-1515 [ DERBY-1515 ]
          Andrew McIntyre made changes -
          Link This issue is related to DERBY-1909 [ DERBY-1909 ]
          Bryan Pendleton made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Fix Version/s 10.3.0.0 [ 12310800 ]
          Resolution Fixed [ 1 ]
          Andrew McIntyre made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Dag H. Wanvik made changes -
          Issue Type New Feature [ 2 ] Improvement [ 4 ]
          Gavin made changes -
          Workflow jira [ 12321727 ] Default workflow, editable Closed status [ 12801305 ]

            People

            • Assignee:
              Bryan Pendleton
              Reporter:
              Kumar Matcha
            • Votes:
              14 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development