forked from docs/doc-exports
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com> Co-authored-by: Lu, Huayi <luhuayi@huawei.com> Co-committed-by: Lu, Huayi <luhuayi@huawei.com>
5.5 KiB
5.5 KiB
DROP SCHEMA
Function
DROP SCHEMA deletes a schema in a database.
Precautions
Only a schema owner or a system administrator can run the DROP SCHEMA command.
Syntax
1 | DROP SCHEMA [ IF EXISTS ] schema_name [, ...] [ CASCADE | RESTRICT ]; |
Parameter Description
- IF EXISTS
Sends a notice instead of an error if the specified schema does not exist.
- schema_name
Specifies the name of a schema.
Value range: An existing schema name.
- CASCADE | RESTRICT
- CASCADE: automatically deletes all objects that are contained in the schema to be deleted.
- RESTRICT: refuses to delete the schema that contains any objects. This is the default.
Example
Delete the ds_new schema.
DROP SCHEMA ds_new;
Links
Parent topic: DDL Syntax