Commands
ALTER SCHEMA
The ALTER SCHEMA
command modifies the definition of a schema. To use this command, you must own the schema.
Syntax
alteroption
depends on the operation you want to perform on the schema. For all supported clauses, see the sections below.
Clause
OWNER TO
Parameter or clause | Description |
---|---|
OWNER TO | This clause changes the owner of the schema. To alter the owner, you must be able to SET ROLE to the new owning role, and you must have the CREATEDB privilege. Note that superusers have all these privileges automatically. |
new_user | The new owner you want to assign to the schema. |
RENAME TO
Parameter or clause | Description |
---|---|
RENAME TO | This clause changes the name of the schema. To rename a schema you must also have the CREATE privilege for the database. Note that superusers have the privilege automatically. |
new_name | The new name of the schema. |
Was this page helpful?