]> begriffs open source - ai-pg/blob - full-docs/txt/sql-dropschema.txt
Convert HTML docs to more streamlined TXT
[ai-pg] / full-docs / txt / sql-dropschema.txt
1
2 DROP SCHEMA
3
4    DROP SCHEMA — remove a schema
5
6 Synopsis
7
8 DROP SCHEMA [ IF EXISTS ] name [, ...] [ CASCADE | RESTRICT ]
9
10 Description
11
12    DROP SCHEMA removes schemas from the database.
13
14    A schema can only be dropped by its owner or a superuser. Note that the
15    owner can drop the schema (and thereby all contained objects) even if
16    they do not own some of the objects within the schema.
17
18 Parameters
19
20    IF EXISTS
21           Do not throw an error if the schema does not exist. A notice is
22           issued in this case.
23
24    name
25           The name of a schema.
26
27    CASCADE
28           Automatically drop objects (tables, functions, etc.) that are
29           contained in the schema, and in turn all objects that depend on
30           those objects (see Section 5.15).
31
32    RESTRICT
33           Refuse to drop the schema if it contains any objects. This is
34           the default.
35
36 Notes
37
38    Using the CASCADE option might make the command remove objects in other
39    schemas besides the one(s) named.
40
41 Examples
42
43    To remove schema mystuff from the database, along with everything it
44    contains:
45 DROP SCHEMA mystuff CASCADE;
46
47 Compatibility
48
49    DROP SCHEMA is fully conforming with the SQL standard, except that the
50    standard only allows one schema to be dropped per command, and apart
51    from the IF EXISTS option, which is a PostgreSQL extension.
52
53 See Also
54
55    ALTER SCHEMA, CREATE SCHEMA