Skip to main content
The DROP SCHEMA removes a user-defined . The DROP SCHEMA statement performs a schema change. For more information about how online schema changes work in CockroachDB, see .

Required privileges

The user must have the DROP on the schema and on all tables in the schema. If the user is the owner of the schema, DROP privileges are not necessary.

Syntax

drop_schema syntax diagram

Parameters

Examples

Setup

To follow along, run to start a temporary, in-memory cluster with the sample dataset preloaded:

Drop a schema

Drop a schema with tables

To drop a schema that contains tables, you need to use the CASCADE keyword.

See also