1DROP SCHEMA(7) SQL Commands DROP SCHEMA(7)
2
3
4
6 DROP SCHEMA - remove a schema
7
8
10 DROP SCHEMA [ IF EXISTS ] name [, ...] [ CASCADE | RESTRICT ]
11
12
14 DROP SCHEMA removes schemas from the database.
15
16 A schema can only be dropped by its owner or a superuser. Note that the
17 owner can drop the schema (and thereby all contained objects) even if
18 he does not own some of the objects within the schema.
19
21 IF EXISTS
22 Do not throw an error if the schema does not exist. A notice is
23 issued in this case.
24
25 name The name of a schema.
26
27 CASCADE
28 Automatically drop objects (tables, functions, etc.) that are
29 contained in the schema.
30
31 RESTRICT
32 Refuse to drop the schema if it contains any objects. This is
33 the default.
34
36 To remove schema mystuff from the database, along with everything it
37 contains:
38
39 DROP SCHEMA mystuff CASCADE;
40
41
43 DROP SCHEMA is fully conforming with the SQL standard, except that the
44 standard only allows one schema to be dropped per command, and apart
45 from the IF EXISTS option, which is a PostgreSQL extension.
46
48 ALTER SCHEMA [alter_schema(7)], CREATE SCHEMA [create_schema(7)]
49
50
51
52SQL - Language Statements 2014-02-17 DROP SCHEMA(7)