~ubuntu-branches/ubuntu/hardy/postgresql-8.4/hardy-backports

« back to all changes in this revision

Viewing changes to doc/src/sgml/ref/drop_function.sgml

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2009-03-20 12:00:13 UTC
  • Revision ID: james.westby@ubuntu.com-20090320120013-hogj7egc5mjncc5g
Tags: upstream-8.4~0cvs20090328
ImportĀ upstreamĀ versionĀ 8.4~0cvs20090328

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<!--
 
2
$PostgreSQL$
 
3
PostgreSQL documentation
 
4
-->
 
5
 
 
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>
 
12
 
 
13
 <refnamediv>
 
14
  <refname>DROP FUNCTION</refname>
 
15
  <refpurpose>remove a function</refpurpose>
 
16
 </refnamediv>
 
17
 
 
18
 <indexterm zone="sql-dropfunction">
 
19
  <primary>DROP FUNCTION</primary>
 
20
 </indexterm>
 
21
 
 
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>
 
28
 
 
29
 <refsect1>
 
30
  <title>Description</title>
 
31
 
 
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>
 
40
 
 
41
 <refsect1>
 
42
  <title>Parameters</title>
 
43
 
 
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>
 
54
 
 
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>
 
63
 
 
64
   <varlistentry>
 
65
    <term><replaceable class="parameter">argmode</replaceable></term>
 
66
 
 
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>
 
80
 
 
81
   <varlistentry>
 
82
    <term><replaceable class="parameter">argname</replaceable></term>
 
83
 
 
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>
 
93
 
 
94
   <varlistentry>
 
95
    <term><replaceable class="parameter">argtype</replaceable></term>
 
96
 
 
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>
 
104
 
 
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>
 
114
 
 
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>
 
126
 
 
127
 <refsect1 id="SQL-DROPFUNCTION-examples">
 
128
  <title>Examples</title>
 
129
 
 
130
  <para>
 
131
   This command removes the square root function:
 
132
 
 
133
<programlisting>
 
134
DROP FUNCTION sqrt(integer);
 
135
</programlisting>
 
136
  </para>
 
137
 </refsect1>
 
138
 
 
139
 <refsect1 id="SQL-DROPFUNCTION-compatibility">
 
140
  <title>Compatibility</title>
 
141
  
 
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>
 
147
 
 
148
 <refsect1>
 
149
  <title>See Also</title>
 
150
 
 
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>
 
156
 
 
157
</refentry>