Fix xslt_process() to ensure that it inserts a NULL terminator after the
[PostgreSQL.git] / doc / src / sgml / ref / drop_function.sgml
blob516c6b40783ea189c7a13e835f99995b0ba0b60d
1 <!--
2 $PostgreSQL$
3 PostgreSQL documentation
4 -->
6 <refentry id="SQL-DROPFUNCTION">
7 <refmeta>
8 <refentrytitle id="SQL-DROPFUNCTION-TITLE">DROP FUNCTION</refentrytitle>
9 <manvolnum>7</manvolnum>
10 <refmiscinfo>SQL - Language Statements</refmiscinfo>
11 </refmeta>
13 <refnamediv>
14 <refname>DROP FUNCTION</refname>
15 <refpurpose>remove a function</refpurpose>
16 </refnamediv>
18 <indexterm zone="sql-dropfunction">
19 <primary>DROP FUNCTION</primary>
20 </indexterm>
22 <refsynopsisdiv>
23 <synopsis>
24 DROP FUNCTION [ IF EXISTS ] <replaceable class="parameter">name</replaceable> ( [ [ <replaceable class="parameter">argmode</replaceable> ] [ <replaceable class="parameter">argname</replaceable> ] <replaceable class="parameter">argtype</replaceable> [, ...] ] )
25 [ CASCADE | RESTRICT ]
26 </synopsis>
27 </refsynopsisdiv>
29 <refsect1>
30 <title>Description</title>
32 <para>
33 <command>DROP FUNCTION</command> removes the definition of an existing
34 function. To execute this command the user must be the
35 owner of the function. The argument types to the
36 function must be specified, since several different functions
37 can exist with the same name and different argument lists.
38 </para>
39 </refsect1>
41 <refsect1>
42 <title>Parameters</title>
44 <variablelist>
45 <varlistentry>
46 <term><literal>IF EXISTS</literal></term>
47 <listitem>
48 <para>
49 Do not throw an error if the function does not exist. A notice is issued
50 in this case.
51 </para>
52 </listitem>
53 </varlistentry>
55 <varlistentry>
56 <term><replaceable class="parameter">name</replaceable></term>
57 <listitem>
58 <para>
59 The name (optionally schema-qualified) of an existing function.
60 </para>
61 </listitem>
62 </varlistentry>
64 <varlistentry>
65 <term><replaceable class="parameter">argmode</replaceable></term>
67 <listitem>
68 <para>
69 The mode of an argument: <literal>IN</>, <literal>OUT</>,
70 <literal>INOUT</>, or <literal>VARIADIC</>.
71 If omitted, the default is <literal>IN</>.
72 Note that <command>DROP FUNCTION</command> does not actually pay
73 any attention to <literal>OUT</> arguments, since only the input
74 arguments are needed to determine the function's identity.
75 So it is sufficient to list the <literal>IN</>, <literal>INOUT</>,
76 and <literal>VARIADIC</> arguments.
77 </para>
78 </listitem>
79 </varlistentry>
81 <varlistentry>
82 <term><replaceable class="parameter">argname</replaceable></term>
84 <listitem>
85 <para>
86 The name of an argument.
87 Note that <command>DROP FUNCTION</command> does not actually pay
88 any attention to argument names, since only the argument data
89 types are needed to determine the function's identity.
90 </para>
91 </listitem>
92 </varlistentry>
94 <varlistentry>
95 <term><replaceable class="parameter">argtype</replaceable></term>
97 <listitem>
98 <para>
99 The data type(s) of the function's arguments (optionally
100 schema-qualified), if any.
101 </para>
102 </listitem>
103 </varlistentry>
105 <varlistentry>
106 <term><literal>CASCADE</literal></term>
107 <listitem>
108 <para>
109 Automatically drop objects that depend on the function (such as
110 operators or triggers).
111 </para>
112 </listitem>
113 </varlistentry>
115 <varlistentry>
116 <term><literal>RESTRICT</literal></term>
117 <listitem>
118 <para>
119 Refuse to drop the function if any objects depend on it. This
120 is the default.
121 </para>
122 </listitem>
123 </varlistentry>
124 </variablelist>
125 </refsect1>
127 <refsect1 id="SQL-DROPFUNCTION-examples">
128 <title>Examples</title>
130 <para>
131 This command removes the square root function:
133 <programlisting>
134 DROP FUNCTION sqrt(integer);
135 </programlisting>
136 </para>
137 </refsect1>
139 <refsect1 id="SQL-DROPFUNCTION-compatibility">
140 <title>Compatibility</title>
142 <para>
143 A <command>DROP FUNCTION</command> statement is defined in the SQL
144 standard, but it is not compatible with this command.
145 </para>
146 </refsect1>
148 <refsect1>
149 <title>See Also</title>
151 <simplelist type="inline">
152 <member><xref linkend="sql-createfunction" endterm="sql-createfunction-title"></member>
153 <member><xref linkend="sql-alterfunction" endterm="sql-alterfunction-title"></member>
154 </simplelist>
155 </refsect1>
157 </refentry>