DROP SCHEMA

DROP SCHEMA — remove a schema

Syntax

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

Description

DROP SCHEMA removes schemas from the database.
Refer to CREATE SCHEMA for information on how to create a schema.

Parameters

Example

Create objects in a schema. Drop the schema.

USE SCHEMA schema1
CREATE DOMAIN schema1.test_domain INTEGER;
CREATE TABLE schema1.test_table (column1 test_domain);
 
DROP SCHEMA schema1;
schema "SCHEMA1" has 1 domain, 0 sequences, 0 roles, and 0 procedures.  CASCADE will drop all
 
DROP SCHEMA schema1 CASCADE;