Renames a schema in a Hologres database.
Syntax
ALTER SCHEMA <old_schema_name> RENAME TO <new_schema_name>;Parameters
| Parameter | Description |
|---|---|
old_schema_name | The current name of the schema to rename. |
new_schema_name | The new name for the schema. |
Limits
Only the schema name can be changed. Other schema attributes are not modifiable.
Example
Rename my_schema to new_schema:
ALTER SCHEMA my_schema RENAME TO new_schema;To switch the current session to the renamed schema, run SET search_path separately:
SET search_path TO new_schema;SET search_pathis a separate command that updates the default schema for the current session. It is not part of theALTER SCHEMAstatement.
该文章对您有帮助吗?