You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Rajesh Kartha (JIRA)" <ji...@apache.org> on 2006/11/05 21:23:18 UTC
[jira] Commented: (DERBY-1490) Provide ALTER TABLE RENAME COLUMN
functionality
[ http://issues.apache.org/jira/browse/DERBY-1490?page=comments#action_12447318 ]
Rajesh Kartha commented on DERBY-1490:
--------------------------------------
The latest patch applied successfully.
An initial observations:
Rename column of a non-existent table throws an ' ALTER TABLE" error:
ij> create table btab (i int, j varchar(100));
0 rows inserted/updated/deleted
ij> rename column btab1.i to id;
ERROR 42Y55: 'ALTER TABLE' cannot be performed on 'BTAB1' because it does not exist.
I would expect this to be consistent to following
ij> rename table abcd to bcd;
ERROR 42Y55: 'RENAME TABLE' cannot be performed on 'ABCD' because it does not exist.
Will try out some other scenarios and provide further comments for the new patch.
Meanwhile, I was thinking:
Like 'RENAME COLUMN" isn't 'RENAME CONSTRAINT' a good feature to have in Derby ?
Currently it is a two step process:
- ALTER TABLE DROP CONSTRAINT
- ALTER TABLE ADD CONSTRAINT
With a 'RENAME CONSTRAINT' this can be done in a single step.
Maybe I will open a JIRA enhancement request to track this.
-Rajesh
> 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: 1490_cannot_patch.jpg, derby1490_v1_needMoreTests.diff, renameColumn_v2_with_tests.diff, renameColumn_v3_after_review.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