Skip to main content
Version: 1.0.16

ALTER SCHEMA

ALTER SCHEMA — Change the Definition of a Schema

Synopsis

ALTER SCHEMA name RENAME TO new_name

ALTER SCHEMA name OWNER TO { new_owner | CURRENT_USER | SESSION_USER }

Description

ALTER SCHEMA changes the definition of a schema.

To use ALTER SCHEMA, you must own the schema. To rename a schema, you must also have CREATE privilege on the database. To change the owner, you must also be a direct or indirect member of the new owning role, and that role must have CREATE privilege on the database (note that a superuser automatically has all these privileges).

Parameters

name

The name of an existing schema.

new_name

The new name of the schema. The new name cannot begin with pg_, as these names are reserved for system schemas.

new_owner

The new owner of the schema.

See Also

CREATE SCHEMA, DROP SCHEMA