1DROP TYPE(7)             PostgreSQL 15.4 Documentation            DROP TYPE(7)
2
3
4

NAME

6       DROP_TYPE - remove a data type
7

SYNOPSIS

9       DROP TYPE [ IF EXISTS ] name [, ...] [ CASCADE | RESTRICT ]
10

DESCRIPTION

12       DROP TYPE removes a user-defined data type. Only the owner of a type
13       can remove it.
14

PARAMETERS

16       IF EXISTS
17           Do not throw an error if the type does not exist. A notice is
18           issued in this case.
19
20       name
21           The name (optionally schema-qualified) of the data type to remove.
22
23       CASCADE
24           Automatically drop objects that depend on the type (such as table
25           columns, functions, and operators), and in turn all objects that
26           depend on those objects (see Section 5.14).
27
28       RESTRICT
29           Refuse to drop the type if any objects depend on it. This is the
30           default.
31

EXAMPLES

33       To remove the data type box:
34
35           DROP TYPE box;
36

COMPATIBILITY

38       This command is similar to the corresponding command in the SQL
39       standard, apart from the IF EXISTS option, which is a PostgreSQL
40       extension. But note that much of the CREATE TYPE command and the data
41       type extension mechanisms in PostgreSQL differ from the SQL standard.
42

SEE ALSO

44       ALTER TYPE (ALTER_TYPE(7)), CREATE TYPE (CREATE_TYPE(7))
45
46
47
48PostgreSQL 15.4                      2023                         DROP TYPE(7)
Impressum