Bug #26949 | Add ALTER TABLE t RENAME COLUMN old_name TO new_name | ||
---|---|---|---|
Submitted: | 8 Mar 2007 6:20 | Modified: | 24 Aug 2017 23:55 |
Reporter: | Hans Ginzel | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: DDL | Severity: | S4 (Feature request) |
Version: | 5.0.26-community-nt | OS: | Windows (MS Windows XP) |
Assigned to: | CPU Architecture: | Any | |
Tags: | rename column |
[8 Mar 2007 6:20]
Hans Ginzel
[29 Apr 2007 12:41]
Valeriy Kravchuk
Thank you for a reasonable feature request.
[3 Mar 2012 12:30]
Valeriy Kravchuk
Bug #58006 was marked as a duplicate of this one.
[3 Mar 2012 12:33]
Valeriy Kravchuk
Bug #32497 was marked as a duplicate of this one.
[23 Feb 2013 11:07]
Jan Naruskevic
It's been 6 years already... Ant still no fix for this?
[10 Dec 2015 6:52]
MySQL Verification Team
I would like this because I'm writing a schema anonymizer that only has to rename columns, but now it has to provide the datatype and nullibility flags and do a ALTER TABLE .. CHANGE .. which is more complex.
[1 May 2017 6:22]
Daniƫl van Eeden
This exact syntax is supported in PostgreSQL, so it also makes migration easier. test=# create table t1 (id int, name varchar(100)); CREATE TABLE test=# alter table t1 rename column name to foo; ALTER TABLE test=# \d t1 Table "public.t1" Column | Type | Modifiers --------+------------------------+----------- id | integer | foo | character varying(100) |
[24 Aug 2017 18:19]
Abhishek Ranjan
Posted by developer: Implemented via worklog WL#10761
[24 Aug 2017 23:55]
Paul DuBois
Posted by developer: Fixed in 8.0.3. ALTER TABLE now supports easier column renaming using RENAME COLUMN old_name TO new_name syntax. RENAME COLUMN is more convenient than CHANGE, which requires respecifying the current column definition.