DROP SCHEMA statement removes a user-defined schema.
The
DROP SCHEMA statement performs a schema change. For more information about how online schema changes work in CockroachDB, see Online Schema Changes.Required privileges
The user must have theDROP privilege 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
Parameters
Examples
Setup
The following examples use MovR, a fictional vehicle-sharing application, to demonstrate CockroachDB SQL statements. For more information about the MovR example application and dataset, see MovR: A Global Vehicle-sharing App. To follow along, runcockroach demo to start a temporary, in-memory cluster with the movr dataset preloaded:
Drop a schema
Drop a schema with tables
To drop a schema that contains tables, you need to use theCASCADE keyword.

