

 Amazon Redshift will no longer support the creation of new Python UDFs starting Patch 198. Existing Python UDFs will continue to function until June 30, 2026. For more information, see the [ blog post ](https://amazonaws-china.com/blogs/big-data/amazon-redshift-python-user-defined-functions-will-reach-end-of-support-after-june-30-2026/). 

# ALTER SCHEMA
<a name="r_ALTER_SCHEMA"></a>

Changes the definition of an existing schema. Use this command to rename a schema 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 new version of that schema. For more information about schemas, see [CREATE SCHEMA](r_CREATE_SCHEMA.md).

To view the configured schema quotas, see [SVV\$1SCHEMA\$1QUOTA\$1STATE](r_SVV_SCHEMA_QUOTA_STATE.md).

To view the records where schema quotas were exceeded, see [STL\$1SCHEMA\$1QUOTA\$1VIOLATIONS](r_STL_SCHEMA_QUOTA_VIOLATIONS.md).

## Required privileges
<a name="r_ALTER_SCHEMA-privileges"></a>

Following are required privileges for ALTER SCHEMA:
+ Superuser
+ User with the ALTER SCHEMA privilege
+ Schema owner

When you change a schema name, note that objects using the old name, such as stored procedures or materialized views, must be updated to use the new name.

## Syntax
<a name="r_ALTER_SCHEMA-synopsis"></a>

```
ALTER SCHEMA schema_name
{
RENAME TO new_name |
OWNER TO new_owner |
QUOTA { quota [MB | GB | TB] | UNLIMITED }
}
```

## Parameters
<a name="r_ALTER_SCHEMA-parameters"></a>

 *schema\$1name*   
The name of the database schema to be altered. 

RENAME TO   
A clause that renames the schema. 

 *new\$1name*   
The new name of the schema. For more information about valid names, see [Names and identifiers](r_names.md). 

OWNER TO   
A clause that changes the owner of the schema. 

 *new\$1owner*   
The new owner of the schema. 

QUOTA   
The maximum amount of disk space that the specified schema can use. This space is the collective size of all tables under the specified schema. Amazon Redshift converts the selected value to megabytes. Gigabytes is the default unit of measurement when you don't specify a value.   
For more information about configuring schema quotas, see [CREATE SCHEMA](r_CREATE_SCHEMA.md).

## Examples
<a name="r_ALTER_SCHEMA-examples"></a>

The following example renames the SALES schema to US\$1SALES.

```
alter schema sales
rename to us_sales;
```

The following example gives ownership of the US\$1SALES schema to the user DWUSER.

```
alter schema us_sales
owner to dwuser;
```

The following example changes the quota to 300 GB and removes the quota.

```
alter schema us_sales QUOTA 300 GB;
alter schema us_sales QUOTA UNLIMITED;
```