1<!--
2doc/src/sgml/ref/drop_cast.sgml
3PostgreSQL documentation
4-->
5
6<refentry id="SQL-DROPCAST">
7 <indexterm zone="sql-dropcast">
8  <primary>DROP CAST</primary>
9 </indexterm>
10
11 <refmeta>
12  <refentrytitle>DROP CAST</refentrytitle>
13  <manvolnum>7</manvolnum>
14  <refmiscinfo>SQL - Language Statements</refmiscinfo>
15 </refmeta>
16
17 <refnamediv>
18  <refname>DROP CAST</refname>
19  <refpurpose>remove a cast</refpurpose>
20 </refnamediv>
21
22 <refsynopsisdiv>
23<synopsis>
24DROP CAST [ IF EXISTS ] (<replaceable>source_type</replaceable> AS <replaceable>target_type</replaceable>) [ CASCADE | RESTRICT ]
25</synopsis>
26 </refsynopsisdiv>
27
28 <refsect1 id="sql-dropcast-description">
29  <title>Description</title>
30
31  <para>
32   <command>DROP CAST</command> removes a previously defined cast.
33  </para>
34
35  <para>
36   To be able to drop a cast, you must own the source or the target
37   data type.  These are the same privileges that are required to
38   create a cast.
39  </para>
40 </refsect1>
41
42 <refsect1>
43  <title>Parameters</title>
44
45   <variablelist>
46
47   <varlistentry>
48    <term><literal>IF EXISTS</literal></term>
49    <listitem>
50     <para>
51      Do not throw an error if the cast does not exist. A notice is issued
52      in this case.
53     </para>
54    </listitem>
55   </varlistentry>
56
57    <varlistentry>
58     <term><replaceable>source_type</replaceable></term>
59
60     <listitem>
61      <para>
62       The name of the source data type of the cast.
63      </para>
64     </listitem>
65    </varlistentry>
66
67    <varlistentry>
68     <term><replaceable>target_type</replaceable></term>
69
70     <listitem>
71      <para>
72       The name of the target data type of the cast.
73      </para>
74     </listitem>
75    </varlistentry>
76
77    <varlistentry>
78     <term><literal>CASCADE</literal></term>
79     <term><literal>RESTRICT</literal></term>
80
81     <listitem>
82      <para>
83       These key words do not have any effect, since there are no
84       dependencies on casts.
85      </para>
86     </listitem>
87    </varlistentry>
88   </variablelist>
89 </refsect1>
90
91 <refsect1 id="sql-dropcast-examples">
92  <title>Examples</title>
93
94  <para>
95   To drop the cast from type <type>text</type> to type <type>int</type>:
96<programlisting>
97DROP CAST (text AS int);
98</programlisting></para>
99 </refsect1>
100
101 <refsect1 id="sql-dropcast-compat">
102  <title>Compatibility</title>
103
104  <para>
105   The <command>DROP CAST</command> command conforms to the SQL standard.
106  </para>
107 </refsect1>
108
109 <refsect1>
110  <title>See Also</title>
111
112  <simplelist type="inline">
113   <member><xref linkend="sql-createcast"></member>
114  </simplelist>
115 </refsect1>
116
117</refentry>
118