summaryrefslogtreecommitdiffstats
path: root/doc/src/sgml/ref/drop_routine.sgml
blob: 6c50eb44a1993acfbf3ed2361981d122289b75a5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<!--
doc/src/sgml/ref/drop_routine.sgml
PostgreSQL documentation
-->

<refentry id="sql-droproutine">
 <indexterm zone="sql-droproutine">
  <primary>DROP ROUTINE</primary>
 </indexterm>

 <refmeta>
  <refentrytitle>DROP ROUTINE</refentrytitle>
  <manvolnum>7</manvolnum>
  <refmiscinfo>SQL - Language Statements</refmiscinfo>
 </refmeta>

 <refnamediv>
  <refname>DROP ROUTINE</refname>
  <refpurpose>remove a routine</refpurpose>
 </refnamediv>

 <refsynopsisdiv>
<synopsis>
DROP ROUTINE [ IF EXISTS ] <replaceable class="parameter">name</replaceable> [ ( [ [ <replaceable class="parameter">argmode</replaceable> ] [ <replaceable class="parameter">argname</replaceable> ] <replaceable class="parameter">argtype</replaceable> [, ...] ] ) ] [, ...]
    [ CASCADE | RESTRICT ]
</synopsis>
 </refsynopsisdiv>

 <refsect1>
  <title>Description</title>

  <para>
   <command>DROP ROUTINE</command> removes the definition of an existing
   routine, which can be an aggregate function, a normal function, or a
   procedure.  See
   under <xref linkend="sql-dropaggregate"/>, <xref linkend="sql-dropfunction"/>,
   and <xref linkend="sql-dropprocedure"/> for the description of the
   parameters, more examples, and further details.
  </para>
 </refsect1>

 <refsect1 id="sql-droproutine-examples">
  <title>Examples</title>

  <para>
   To drop the routine <literal>foo</literal> for type
   <type>integer</type>:
<programlisting>
DROP ROUTINE foo(integer);
</programlisting>
   This command will work independent of whether <literal>foo</literal> is an
   aggregate, function, or procedure.
  </para>
 </refsect1>

 <refsect1 id="sql-droproutine-compatibility">
  <title>Compatibility</title>

  <para>
   This command conforms to the SQL standard, with
   these <productname>PostgreSQL</productname> extensions:
   <itemizedlist>
    <listitem>
     <para>The standard only allows one routine to be dropped per command.</para>
    </listitem>
    <listitem>
     <para>The <literal>IF EXISTS</literal> option</para>
    </listitem>
    <listitem>
     <para>The ability to specify argument modes and names</para>
    </listitem>
    <listitem>
     <para>Aggregate functions are an extension.</para>
    </listitem>
   </itemizedlist></para>
 </refsect1>

 <refsect1>
  <title>See Also</title>

  <simplelist type="inline">
   <member><xref linkend="sql-dropaggregate"/></member>
   <member><xref linkend="sql-dropfunction"/></member>
   <member><xref linkend="sql-dropprocedure"/></member>
   <member><xref linkend="sql-alterroutine"/></member>
  </simplelist>

  <para>
   Note that there is no <literal>CREATE ROUTINE</literal> command.
  </para>
 </refsect1>

</refentry>