Commands
DROP SCHEMA
Use the DROP SCHEMA
command to remove a schema from a database.
Before you can remove a schema, you must remove all its dependent objects (tables, materialized views, etc.).
Syntax
Parameters
Parameter or clause | Description |
---|---|
IF EXISTS clause | Do not return an error if the specified schema does not exist. |
database | 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 | 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. |
Examples
This statement removes the rw_schema
schema from the rw_db
database:
This statement removes the rw_schema
schema from the dev
database (default database):
Use this statement if you don’t want RisingWave to return an error if the schema you want to remove does not exist:
Was this page helpful?