RENAME SCHEMA
Renaming schemas is mainly used for improving the clarity and organization of a database by giving schemas more meaningful or concise names.
Warning
Renaming a schema can void existing views that use this schema. See more about recompiling views.
Permissions
The role must have the DDL
permission at the database level.
Syntax
alter_schema_rename_schema_statement ::=
ALTER SCHEMA [database_name.]current_name RENAME TO new_name
;
current_name ::= identifier
database_name ::= identifier
new_name ::= identifier
Parameters
Parameter |
Description |
---|---|
|
The database name for the schema. Defaults to |
|
The schema name to apply the change to. |
|
The new schema name. |
Examples
ALTER SCHEMA master.staging RENAME TO staging_new;