3
PostgreSQL documentation
6
<refentry id="SQL-DROPFUNCTION">
8
<refentrytitle id="SQL-DROPFUNCTION-TITLE">DROP FUNCTION</refentrytitle>
9
<manvolnum>7</manvolnum>
10
<refmiscinfo>SQL - Language Statements</refmiscinfo>
14
<refname>DROP FUNCTION</refname>
15
<refpurpose>remove a function</refpurpose>
18
<indexterm zone="sql-dropfunction">
19
<primary>DROP FUNCTION</primary>
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 ]
30
<title>Description</title>
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.
42
<title>Parameters</title>
46
<term><literal>IF EXISTS</literal></term>
49
Do not throw an error if the function does not exist. A notice is issued
56
<term><replaceable class="parameter">name</replaceable></term>
59
The name (optionally schema-qualified) of an existing function.
65
<term><replaceable class="parameter">argmode</replaceable></term>
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.
82
<term><replaceable class="parameter">argname</replaceable></term>
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.
95
<term><replaceable class="parameter">argtype</replaceable></term>
99
The data type(s) of the function's arguments (optionally
100
schema-qualified), if any.
106
<term><literal>CASCADE</literal></term>
109
Automatically drop objects that depend on the function (such as
110
operators or triggers).
116
<term><literal>RESTRICT</literal></term>
119
Refuse to drop the function if any objects depend on it. This
127
<refsect1 id="SQL-DROPFUNCTION-examples">
128
<title>Examples</title>
131
This command removes the square root function:
134
DROP FUNCTION sqrt(integer);
139
<refsect1 id="SQL-DROPFUNCTION-compatibility">
140
<title>Compatibility</title>
143
A <command>DROP FUNCTION</command> statement is defined in the SQL
144
standard, but it is not compatible with this command.
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>