]> granicus.if.org Git - postgresql/blob - doc/src/sgml/ref/drop_function.sgml
A bunch of small doco updates motivated by scanning the comments on
[postgresql] / doc / src / sgml / ref / drop_function.sgml
1 <!--
2 $Header: /cvsroot/pgsql/doc/src/sgml/ref/drop_function.sgml,v 1.15 2001/11/19 03:58:25 tgl Exp $
3 Postgres documentation
4 -->
5
6 <refentry id="SQL-DROPFUNCTION">
7  <refmeta>
8   <refentrytitle id="SQL-DROPFUNCTION-TITLE">
9    DROP FUNCTION
10   </refentrytitle>
11   <refmiscinfo>SQL - Language Statements</refmiscinfo>
12  </refmeta>
13  <refnamediv>
14   <refname>
15    DROP FUNCTION
16   </refname>
17   <refpurpose>
18    remove a user-defined function
19   </refpurpose>
20  </refnamediv>
21  <refsynopsisdiv>
22   <refsynopsisdivinfo>
23    <date>1999-07-20</date>
24   </refsynopsisdivinfo>
25   <synopsis>
26 DROP FUNCTION <replaceable class="parameter">name</replaceable> ( [ <replaceable class="parameter">type</replaceable> [, ...] ] )
27   </synopsis>
28
29   <refsect2 id="R2-SQL-DROPFUNCTION-1">
30    <refsect2info>
31     <date>1998-04-15</date>
32    </refsect2info>
33    <title>
34     Inputs
35    </title>
36    <para>
37     <variablelist>
38      <varlistentry>
39       <term><replaceable class="parameter">name</replaceable></term>
40       <listitem>
41        <para>
42         The name of an existing function.
43        </para>
44       </listitem>
45      </varlistentry>
46      <varlistentry>
47       <term><replaceable class="parameter">type</replaceable></term>
48       <listitem>
49        <para>
50         The type of the function's parameters.
51        </para>
52       </listitem>
53      </varlistentry>
54     </variablelist>
55    </para>
56   </refsect2>
57
58   <refsect2 id="R2-SQL-DROPFUNCTION-2">
59    <refsect2info>
60     <date>1998-04-15</date>
61    </refsect2info>
62    <title>
63     Outputs
64    </title>
65    <para>
66
67     <variablelist>
68      <varlistentry>
69       <term><computeroutput>
70 DROP
71        </computeroutput></term>
72       <listitem>
73        <para>
74         Message returned if the command completes successfully.
75        </para>
76       </listitem>
77      </varlistentry>
78      <varlistentry>
79       <term><computeroutput>
80 NOTICE RemoveFunction: Function "<replaceable class="parameter">name</replaceable>" ("<replaceable class="parameter">types</replaceable>") does not exist
81        </computeroutput></term>
82       <listitem>
83        <para>
84         This message is given if the function specified does not
85         exist in the current database.
86        </para>
87       </listitem>
88      </varlistentry>
89     </variablelist>
90    </para>
91   </refsect2>
92  </refsynopsisdiv>
93
94  <refsect1 id="R1-SQL-DROPFUNCTION-1">
95   <refsect1info>
96    <date>1998-04-15</date>
97   </refsect1info>
98   <title>
99    Description
100   </title>
101   <para>
102    DROP FUNCTION will remove the definition of an existing
103    function. To execute this command the user must be the
104    owner of the function. The input argument types to the
105    function must be specified, since several different functions
106    may exist with the same name and different argument lists.
107   </para>
108  </refsect1>
109
110  <refsect1 id="SQL-DROPFUNCTION-notes">
111   <title>Notes</title>
112
113    <para>
114     Refer to
115     <xref linkend="sql-createfunction">
116     for information on creating functions.
117    </para>
118
119    <para>
120     No checks are made to ensure that types, operators, access
121     methods, or triggers that rely on the function have been removed first.
122    </para>
123  </refsect1>
124
125  <refsect1 id="SQL-DROPFUNCTION-examples">
126   <title>Examples</title>
127
128   <para>
129    This command removes the square root function:
130
131 <programlisting>
132 DROP FUNCTION sqrt(integer);
133 </programlisting>
134   </para>
135  </refsect1>
136
137  <refsect1 id="SQL-DROPFUNCTION-compatibility">
138   <title>Compatibility</title>
139   
140   <para>
141    A <command>DROP FUNCTION</command> statement is defined in SQL99.  One of its syntax forms is:
142
143 <synopsis>
144 DROP FUNCTION <replaceable class="parameter">name</replaceable> (<replaceable>arg</>, ...) { RESTRICT | CASCADE }
145 </synopsis>
146
147    where <literal>CASCADE</> specifies dropping all objects that
148    depend on the function and <literal>RESTRICT</literal> refuses to
149    drop the function if dependent objects exist.
150   </para>
151  </refsect1>
152
153  <refsect1>
154   <title>See Also</title>
155
156   <simplelist type="inline">
157    <member><xref linkend="sql-createfunction"></member>
158   </simplelist>
159  </refsect1>
160 </refentry>
161
162 <!-- Keep this comment at the end of the file
163 Local variables:
164 mode: sgml
165 sgml-omittag:nil
166 sgml-shorttag:t
167 sgml-minimize-attributes:nil
168 sgml-always-quote-attributes:t
169 sgml-indent-step:1
170 sgml-indent-data:t
171 sgml-parent-document:nil
172 sgml-default-dtd-file:"../reference.ced"
173 sgml-exposed-tags:nil
174 sgml-local-catalogs:"/usr/lib/sgml/catalog"
175 sgml-local-ecat-files:nil
176 End:
177 -->