Syntax
Parameters
| Parameter | Description |
|---|---|
<schema_name> | The name of the schema to delete. |
IF EXISTS | Prevents an error if the schema does not exist. Without this clause, the statement fails if the schema is missing. |
CASCADE | Drops the schema and all objects it contains, including tables, views, and aggregating indexes. |
RESTRICT | Prevents the schema from being dropped if it contains any objects. This is the default behavior. |
Examples
Drop an empty schemaanalytics schema contains any tables, views, or other objects:
Related commands
- CREATE SCHEMA - Create a schema
- ALTER SCHEMA - Modify schema properties