So far I've seen ALTER TABLE RENAME
, ALTER TABLE CHANGE
and ALTER TABLE MODIFY
.
What I'm trying to achieve is something like ALTER TABLE my_table RENAME col_old_name TO col_new_name
, which can be a case of modifying a column.
SQLite goes with RENAME
.
MariaDB and MySQL have all three.
Postgres goes with RENAME
.
Oracle has RENAME
and MODIFY
.
Standards are unkown to SQL Server.
What is the database-agnostic way for renaming (or generally altering) a column?
Maybe I'm erroneously expecting the standard to cover DDL operations as well? I have code that works with multiple databases so would rather make the SQL part as portable as possible.