2 doc/src/sgml/ref/drop_type.sgml
3 PostgreSQL documentation
6 <refentry id="SQL-DROPTYPE">
8 <refentrytitle>DROP TYPE</refentrytitle>
9 <manvolnum>7</manvolnum>
10 <refmiscinfo>SQL - Language Statements</refmiscinfo>
14 <refname>DROP TYPE</refname>
15 <refpurpose>remove a data type</refpurpose>
18 <indexterm zone="sql-droptype">
19 <primary>DROP TYPE</primary>
24 DROP TYPE [ IF EXISTS ] <replaceable class="PARAMETER">name</replaceable> [, ...] [ CASCADE | RESTRICT ]
29 <title>Description</title>
32 <command>DROP TYPE</command> removes a user-defined data type.
33 Only the owner of a type can remove it.
38 <title>Parameters</title>
42 <term><literal>IF EXISTS</literal></term>
45 Do not throw an error if the type does not exist. A notice is issued
52 <term><replaceable class="PARAMETER">name</replaceable></term>
55 The name (optionally schema-qualified) of the data type to remove.
61 <term><literal>CASCADE</literal></term>
64 Automatically drop objects that depend on the type (such as
65 table columns, functions, operators).
71 <term><literal>RESTRICT</literal></term>
74 Refuse to drop the type if any objects depend on it. This is
82 <refsect1 id="SQL-DROPTYPE-examples">
83 <title>Examples</title>
86 To remove the data type <type>box</type>:
89 </programlisting></para>
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 much of 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-altertype"></member>
110 <member><xref linkend="sql-createtype"></member>