2 .\" Title: DROP FUNCTION
3 .\" Author: The PostgreSQL Global Development Group
4 .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
6 .\" Manual: PostgreSQL 18.0 Documentation
7 .\" Source: PostgreSQL 18.0
10 .TH "DROP FUNCTION" "7" "2025" "PostgreSQL 18.0" "PostgreSQL 18.0 Documentation"
11 .\" -----------------------------------------------------------------
12 .\" * Define some portability stuff
13 .\" -----------------------------------------------------------------
14 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 .\" http://bugs.debian.org/507673
16 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
20 .\" -----------------------------------------------------------------
21 .\" * set default formatting
22 .\" -----------------------------------------------------------------
23 .\" disable hyphenation
25 .\" disable justification (adjust text to left margin only)
27 .\" -----------------------------------------------------------------
28 .\" * MAIN CONTENT STARTS HERE *
29 .\" -----------------------------------------------------------------
31 DROP_FUNCTION \- remove a function
35 DROP FUNCTION [ IF EXISTS ] \fIname\fR [ ( [ [ \fIargmode\fR ] [ \fIargname\fR ] \fIargtype\fR [, \&.\&.\&.] ] ) ] [, \&.\&.\&.]
36 [ CASCADE | RESTRICT ]
41 removes the definition of an existing function\&. To execute this command the user must be the owner of the function\&. The argument types to the function must be specified, since several different functions can exist with the same name and different argument lists\&.
46 Do not throw an error if the function does not exist\&. A notice is issued in this case\&.
51 The name (optionally schema\-qualified) of an existing function\&. If no argument list is specified, the name must be unique in its schema\&.
56 The mode of an argument:
60 VARIADIC\&. If omitted, the default is
63 does not actually pay any attention to
65 arguments, since only the input arguments are needed to determine the function\*(Aqs identity\&. So it is sufficient to list the
74 The name of an argument\&. Note that
76 does not actually pay any attention to argument names, since only the argument data types are needed to determine the function\*(Aqs identity\&.
81 The data type(s) of the function\*(Aqs arguments (optionally schema\-qualified), if any\&.
86 Automatically drop objects that depend on the function (such as operators or triggers), and in turn all objects that depend on those objects (see
92 Refuse to drop the function if any objects depend on it\&. This is the default\&.
96 This command removes the square root function:
102 DROP FUNCTION sqrt(integer);
108 Drop multiple functions in one command:
114 DROP FUNCTION sqrt(integer), sqrt(bigint);
120 If the function name is unique in its schema, it can be referred to without an argument list:
126 DROP FUNCTION update_employee_salaries;
132 Note that this is different from
138 DROP FUNCTION update_employee_salaries();
144 which refers to a function with zero arguments, whereas the first variant can refer to a function with any number of arguments, including zero, as long as the name is unique\&.
147 This command conforms to the SQL standard, with these
159 The standard only allows one function to be dropped per command\&.
183 The ability to specify argument modes and names
186 CREATE FUNCTION (\fBCREATE_FUNCTION\fR(7)), ALTER FUNCTION (\fBALTER_FUNCTION\fR(7)), DROP PROCEDURE (\fBDROP_PROCEDURE\fR(7)), DROP ROUTINE (\fBDROP_ROUTINE\fR(7))