Syntax
Parameters
Examples
This statement removes therw_schema schema from the rw_db database:
rw_schema schema from the dev database (default database):
rw_schema schema and everything it contains from the database:
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Use the DROP SCHEMA command to remove a schema from a database.
DROP SCHEMA [ IF EXISTS ] [database_name.]schema_name [ CASCADE ];
| Parameter or clause | Description |
|---|---|
| IF EXISTS clause | Do not return an error if the specified schema does not exist. |
| database_name | Specify the name of a database to remove the schema in that database. You can use SHOW DATABASES to get a list of all available databases. If you don’t specify a database, the specified schema in the default database will be removed. |
| schema_name | The name of the schema you want to remove. The default schema is public. You can use SHOW SCHEMAS to get a list of all available schemas. |
| CASCADE | Automatically drops the schema’s dependent objects (tables, materialized views, etc.) and any objects that depend on those objects. |
rw_schema schema from the rw_db database:
DROP SCHEMA rw_db.rw_schema;
rw_schema schema from the dev database (default database):
DROP SCHEMA rw_schema;
DROP SCHEMA IF EXISTS rw_schema;
rw_schema schema and everything it contains from the database:
DROP SCHEMA rw_schema CASCADE;
Was this page helpful?