db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bryan Pendleton (JIRA)" <derby-...@db.apache.org>
Subject [jira] Updated: (DERBY-1490) Provide ALTER TABLE RENAME COLUMN functionality
Date Fri, 20 Oct 2006 01:15:36 GMT
     [ http://issues.apache.org/jira/browse/DERBY-1490?page=all ]

Bryan Pendleton updated DERBY-1490:
-----------------------------------

    Attachment: renameColumn_v2_with_tests.diff

Attached is 'renameColumn_v2_with_tests.diff', a patch proposal which is,
I think, ready for review.

I'm interested in all feedback, but I particularly want to draw your attention
to the following questions:

1) The patch proposes to add support for *both* of these syntaxes:
       ALTER TABLE t RENAME COLUMN c1 TO c2
   and
       RENAME COLUMN t.c1 to c2;

   I think it's probably wrong to add both syntaxes, but I'm not sure which
   one to prefer, so I've implemented both and am now looking for feedback
   about which one is better. (Or, if you think we should implement both, why?)

2) Are there test cases that are missing?

3) Is the handling of active prepared statements satisfactory? With the patch,
   if there is a prepared statement against the table, and you rename a
   column in the table, the rename is successful, and later attempts to execute
   the prepared statement get a "the column does not exist" error. I think it's
   pretty reasonable: the error message is accurate and the behavior is
   deterministic, but maybe there is room for improvement here?

4) Is the handling of triggers satisfactory? With the patch, you cannot rename
   a column which would cause the *firing* of a trigger, but you are able to
   successfully rename a column which is used by the *body* of the trigger. In
   that case, the behavior is similar to that of the prepared statement case
   above: the rename column succeeds, and the next time the trigger fires, it
   gets a "column does not exist" error. Again, I think the behavior is pretty
   reasonable: the error message is clear and the behavior is deterministic,
   but again I'm looking for your reaction.

I haven't worked on the documentation yet, partly because until we know which
syntax we prefer, it's hard to know which doc pages to update.

Please let me know your comments and suggestions on this patch.




> Provide ALTER TABLE RENAME COLUMN functionality
> -----------------------------------------------
>
>                 Key: DERBY-1490
>                 URL: http://issues.apache.org/jira/browse/DERBY-1490
>             Project: Derby
>          Issue Type: New Feature
>          Components: Documentation, SQL
>    Affects Versions: 10.0.2.0, 10.0.2.1, 10.1.1.0, 10.2.1.6, 10.1.2.1, 10.1.3.1
>            Reporter: Bryan Pendleton
>         Assigned To: Bryan Pendleton
>         Attachments: derby1490_v1_needMoreTests.diff, renameColumn_v2_with_tests.diff
>
>
> Provide a way to rename a column in an existing table. Possible syntax could be:
>   ALTER TABLE tablename RENAME COLUMN oldcolumn TO newcolumn;
> Feature should properly handle the possibility that the column is currently used in constraints,
views, indexes, triggers, etc.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message