Skip to content

ALTER SCHEMA

Alter attributes of an existing schema. You can change the name of a schema, and you can change its owner.

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

For example, rename a schema, then change its owner. The new owner must be an existing database user.

premdb=# alter schema premdb rename to newprem;
ALTER SCHEMA
premdb=# alter schema newprem owner to bobr;
ALTER SCHEMA

Parent topic:SQL Commands