Make LC_COLLATE and LC_CTYPE database-level settings. Collation and
[PostgreSQL.git] / doc / src / sgml / ref / drop_type.sgml
blob3d89b21b8c4e19044e7913905307feb5e686797b
1 <!--
2 $PostgreSQL$
3 PostgreSQL documentation
4 -->
6 <refentry id="SQL-DROPTYPE">
7 <refmeta>
8 <refentrytitle id="SQL-DROPTYPE-TITLE">DROP TYPE</refentrytitle>
9 <refmiscinfo>SQL - Language Statements</refmiscinfo>
10 </refmeta>
12 <refnamediv>
13 <refname>DROP TYPE</refname>
14 <refpurpose>remove a data type</refpurpose>
15 </refnamediv>
17 <indexterm zone="sql-droptype">
18 <primary>DROP TYPE</primary>
19 </indexterm>
21 <refsynopsisdiv>
22 <synopsis>
23 DROP TYPE [ IF EXISTS ] <replaceable class="PARAMETER">name</replaceable> [, ...] [ CASCADE | RESTRICT ]
24 </synopsis>
25 </refsynopsisdiv>
27 <refsect1>
28 <title>Description</title>
30 <para>
31 <command>DROP TYPE</command> removes a user-defined data type.
32 Only the owner of a type can remove it.
33 </para>
34 </refsect1>
36 <refsect1>
37 <title>Parameters</title>
39 <variablelist>
40 <varlistentry>
41 <term><literal>IF EXISTS</literal></term>
42 <listitem>
43 <para>
44 Do not throw an error if the type does not exist. A notice is issued
45 in this case.
46 </para>
47 </listitem>
48 </varlistentry>
50 <varlistentry>
51 <term><replaceable class="PARAMETER">name</replaceable></term>
52 <listitem>
53 <para>
54 The name (optionally schema-qualified) of the data type to remove.
55 </para>
56 </listitem>
57 </varlistentry>
59 <varlistentry>
60 <term><literal>CASCADE</literal></term>
61 <listitem>
62 <para>
63 Automatically drop objects that depend on the type (such as
64 table columns, functions, operators).
65 </para>
66 </listitem>
67 </varlistentry>
69 <varlistentry>
70 <term><literal>RESTRICT</literal></term>
71 <listitem>
72 <para>
73 Refuse to drop the type if any objects depend on it. This is
74 the default.
75 </para>
76 </listitem>
77 </varlistentry>
78 </variablelist>
79 </refsect1>
81 <refsect1 id="SQL-DROPTYPE-examples">
82 <title>Examples</title>
84 <para>
85 To remove the data type <type>box</type>:
86 <programlisting>
87 DROP TYPE box;
88 </programlisting>
89 </para>
90 </refsect1>
92 <refsect1 id="SQL-DROPTYPE-compatibility">
93 <title>Compatibility</title>
95 <para>
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.
102 </para>
103 </refsect1>
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>
111 </simplelist>
112 </refsect1>
114 </refentry>