Materialize Logo

DROP SCHEMA

DROP SCHEMA removes a schema from your Materialize instances.

Syntax

DROP SCHEMA IF EXISTS schema_name CASCADE RESTRICT
Field Use
IF EXISTS Do not return an error if the specified schema does not exist.
schema_name The schema you want to drop. For available schemas, see SHOW SCHEMAS.
RESTRICT Do not drop this schema if it contains any sources or views. (Default)
CASCADE Drop all views and sources within this schema.

Details

Before you can drop a schema, you must drop all sources and views it contains, or use the CASCADE option.

Example

SHOW SOURCES FROM my_schema
my_file_source
DROP SCHEMA my_schema
schema 'my_schema' cannot be dropped without CASCADE while it contains objects
DROP SCHEMA my_schema CASCADE