> ## Documentation Index
> Fetch the complete documentation index at: https://docs.risingwave.com/llms.txt
> Use this file to discover all available pages before exploring further.

# ALTER SCHEMA

> The `ALTER SCHEMA` command modifies the definition of a schema. To use this command, you must own the schema.

## Syntax

```sql theme={null}
ALTER SCHEMA current_schema_name
    alter_option;
```

*`alter_option`* depends on the operation you want to perform on the schema. For all supported clauses, see the sections below.

## Clause

### `OWNER TO`

```SQL theme={null}
ALTER SCHEMA current_schema_name
    OWNER TO new_user;
```

| 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.                                                                                                                                                                               |

```sql theme={null}
-- Change the owner of the schema named "schema1" to user "user1"
ALTER SCHEMA schema1 OWNER TO user1;
```

### `RENAME TO`

```sql theme={null}
ALTER SCHEMA current_schema_name
    RENAME TO new_name;
```

| 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.                                                                                                                                                     |

```sql theme={null}
-- Rename the schema named "schema0" to "schema1".
ALTER SCHEMA schema0 RENAME TO schema1;
```
