1<!-- 2doc/src/sgml/ref/drop_routine.sgml 3PostgreSQL documentation 4--> 5 6<refentry id="sql-droproutine"> 7 <indexterm zone="sql-droproutine"> 8 <primary>DROP ROUTINE</primary> 9 </indexterm> 10 11 <refmeta> 12 <refentrytitle>DROP ROUTINE</refentrytitle> 13 <manvolnum>7</manvolnum> 14 <refmiscinfo>SQL - Language Statements</refmiscinfo> 15 </refmeta> 16 17 <refnamediv> 18 <refname>DROP ROUTINE</refname> 19 <refpurpose>remove a routine</refpurpose> 20 </refnamediv> 21 22 <refsynopsisdiv> 23<synopsis> 24DROP ROUTINE [ 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 ROUTINE</command> removes the definition of an existing 34 routine, which can be an aggregate function, a normal function, or a 35 procedure. See 36 under <xref linkend="sql-dropaggregate"/>, <xref linkend="sql-dropfunction"/>, 37 and <xref linkend="sql-dropprocedure"/> for the description of the 38 parameters, more examples, and further details. 39 </para> 40 </refsect1> 41 42 <refsect1 id="sql-droproutine-examples"> 43 <title>Examples</title> 44 45 <para> 46 To drop the routine <literal>foo</literal> for type 47 <type>integer</type>: 48<programlisting> 49DROP ROUTINE foo(integer); 50</programlisting> 51 This command will work independent of whether <literal>foo</literal> is an 52 aggregate, function, or procedure. 53 </para> 54 </refsect1> 55 56 <refsect1 id="sql-droproutine-compatibility"> 57 <title>Compatibility</title> 58 59 <para> 60 This command conforms to the SQL standard, with 61 these <productname>PostgreSQL</productname> extensions: 62 <itemizedlist> 63 <listitem> 64 <para>The standard only allows one routine to be dropped per command.</para> 65 </listitem> 66 <listitem> 67 <para>The <literal>IF EXISTS</literal> option</para> 68 </listitem> 69 <listitem> 70 <para>The ability to specify argument modes and names</para> 71 </listitem> 72 <listitem> 73 <para>Aggregate functions are an extension.</para> 74 </listitem> 75 </itemizedlist> 76 </para> 77 </refsect1> 78 79 <refsect1> 80 <title>See Also</title> 81 82 <simplelist type="inline"> 83 <member><xref linkend="sql-dropaggregate"/></member> 84 <member><xref linkend="sql-dropfunction"/></member> 85 <member><xref linkend="sql-dropprocedure"/></member> 86 <member><xref linkend="sql-alterroutine"/></member> 87 </simplelist> 88 89 <para> 90 Note that there is no <literal>CREATE ROUTINE</literal> command. 91 </para> 92 </refsect1> 93 94</refentry> 95