3 PostgreSQL documentation
6 <refentry id=
"SQL-DROPTYPE">
8 <refentrytitle id=
"SQL-DROPTYPE-TITLE">DROP TYPE
</refentrytitle>
9 <refmiscinfo>SQL - Language Statements
</refmiscinfo>
13 <refname>DROP TYPE
</refname>
14 <refpurpose>remove a data type
</refpurpose>
17 <indexterm zone=
"sql-droptype">
18 <primary>DROP TYPE
</primary>
23 DROP TYPE [ IF EXISTS ]
<replaceable class=
"PARAMETER">name
</replaceable> [, ...] [ CASCADE | RESTRICT ]
28 <title>Description
</title>
31 <command>DROP TYPE
</command> removes a user-defined data type.
32 Only the owner of a type can remove it.
37 <title>Parameters
</title>
41 <term><literal>IF EXISTS
</literal></term>
44 Do not throw an error if the type does not exist. A notice is issued
51 <term><replaceable class=
"PARAMETER">name
</replaceable></term>
54 The name (optionally schema-qualified) of the data type to remove.
60 <term><literal>CASCADE
</literal></term>
63 Automatically drop objects that depend on the type (such as
64 table columns, functions, operators).
70 <term><literal>RESTRICT
</literal></term>
73 Refuse to drop the type if any objects depend on it. This is
81 <refsect1 id=
"SQL-DROPTYPE-examples">
82 <title>Examples
</title>
85 To remove the data type
<type>box
</type>:
92 <refsect1 id=
"SQL-DROPTYPE-compatibility">
93 <title>Compatibility
</title>
96 This command is similar to the corresponding command in the SQL
97 standard, apart from the
<literal>IF EXISTS<
/>
98 option, which is a
<productname>PostgreSQL<
/> extension.
99 But note that the
<command>CREATE TYPE
</command> command
100 and the data type extension mechanisms in
101 <productname>PostgreSQL
</productname> differ from the SQL standard.
105 <refsect1 id=
"SQL-DROPTYPE-see-also">
106 <title>See Also
</title>
108 <simplelist type=
"inline">
109 <member><xref linkend=
"sql-createtype" endterm=
"sql-createtype-title"></member>
110 <member><xref linkend=
"sql-altertype" endterm=
"sql-altertype-title"></member>