Menu
Amazon Redshift
Database Developer Guide (API Version 2012-12-01)

ALTER SCHEMA

Changes the definition of an existing schema. Use this command to rename or change the owner of a schema.

For example, rename an existing schema to preserve a backup copy of that schema when you plan to create a newer version of that schema. See CREATE SCHEMA for more information about schemas.

Syntax

Copy
ALTER SCHEMA schema_name { RENAME TO new_name | OWNER TO new_owner }

Parameters

schema_name

Name of the database schema to be altered.

RENAME TO

Renames the schema.

new_name

The new name of the schema. For more information about valid names, see Names and Identifiers.

OWNER TO

Changes the owner of the schema.

new_owner

The new owner of the schema.

Examples

The following example renames the SALES schema to US_SALES:

Copy
alter schema sales rename to us_sales;

The following example gives ownership of the US_SALES schema to the user DWUSER:

Copy
alter schema us_sales owner to dwuser;