[MDEV-16290] ALTER TABLE ... RENAME COLUMN syntax Created: 2018-05-25 Updated: 2022-12-01 Resolved: 2020-03-03 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Data Definition - Alter Table, Parser |
| Fix Version/s: | 10.5.2 |
| Type: | Task | Priority: | Critical |
| Reporter: | Enrique Matías Sánchez | Assignee: | Aleksey Midenkov |
| Resolution: | Fixed | Votes: | 5 |
| Labels: | Compatibility | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||
| Description |
|
To rename a column, MariaDB provides this syntax:
which requires re-specification of all the attributes of the column. Disadvantages of the above syntax :
The proposed syntax, supported by MySQL 8.0, Oracle and PostgreSQL, is:
The new proposed syntax is expected to behave the same as "ALTER TABLE ... The old syntax "ALTER TABLE ... CHANGE" to rename the column will continue MySQL tickets: WL#10761, WL#6555 |
| Comments |
| Comment by Aleksey Midenkov [ 2019-06-13 ] |
|
Good point. MySQL 8.0 already has it. Should be done along with RENAME {INDEX|KEY}. https://dev.mysql.com/doc/refman/8.0/en/alter-table.html Question on StackOverflow: Does MariaDB support renaming an index? |
| Comment by Enrique Matías Sánchez [ 2020-03-03 ] |
|
Thanks, Aleksey! |