]> begriffs open source - ai-pg/blob - full-docs/txt/sql-droptype.txt
Convert HTML docs to more streamlined TXT
[ai-pg] / full-docs / txt / sql-droptype.txt
1
2 DROP TYPE
3
4    DROP TYPE — remove a data type
5
6 Synopsis
7
8 DROP TYPE [ IF EXISTS ] name [, ...] [ CASCADE | RESTRICT ]
9
10 Description
11
12    DROP TYPE removes a user-defined data type. Only the owner of a type
13    can remove it.
14
15 Parameters
16
17    IF EXISTS
18           Do not throw an error if the type does not exist. A notice is
19           issued in this case.
20
21    name
22           The name (optionally schema-qualified) of the data type to
23           remove.
24
25    CASCADE
26           Automatically drop objects that depend on the type (such as
27           table columns, functions, and operators), and in turn all
28           objects that depend on those objects (see Section 5.15).
29
30    RESTRICT
31           Refuse to drop the type if any objects depend on it. This is the
32           default.
33
34 Examples
35
36    To remove the data type box:
37 DROP TYPE box;
38
39 Compatibility
40
41    This command is similar to the corresponding command in the SQL
42    standard, apart from the IF EXISTS option, which is a PostgreSQL
43    extension. But note that much of the CREATE TYPE command and the data
44    type extension mechanisms in PostgreSQL differ from the SQL standard.
45
46 See Also
47
48    ALTER TYPE, CREATE TYPE