RENAME COLUMN
The RENAME COLUMN
command can be used to rename columns in a table.
Syntax
ALTER TABLE [schema_name.]table_name RENAME COLUMN current_name TO new_name
schema_name ::= identifier
table_name ::= identifier
current_name ::= identifier
new_name ::= identifier
Parameters
Parameter |
Description |
---|---|
|
The schema name for the table. Defaults to |
|
The table name to apply the change to |
|
The column to rename |
|
The new column name |
Examples
Renaming a Column
ALTER TABLE
users RENAME COLUMN weight TO mass;
Renaming a Quoted Name
ALTER TABLE
users RENAME COLUMN "mass" TO "Mass" (Kilograms);
Permissions
The role must have the DDL
permission at the database or table level.