All Products
Search
Document Center

Hologres:DROP SCHEMA

Last Updated:Dec 02, 2024

You can execute the DROP SCHEMA statement to delete a schema from a database. This topic describes how to use the DROP SCHEMA statement and the limits on using the statement.

Limits

You cannot delete the public schema, which is automatically created by Hologres for each database.

Syntax

DROP SCHEMA [ IF EXISTS ] name [, ...] [ CASCADE | RESTRICT ]

The following table describes the parameters in the preceding syntax.

Parameter

Description

CASCADE

The keyword indicating that the system automatically deletes all objects such as tables, functions, and data in the destination schema.

RESTRICT

The keyword indicating that the system does not delete a schema if the schema contains any objects.

Example

DROP SCHEMA mystuff CASCADE; -- You can replace mystuff with a custom schema name.