4 DROP FUNCTION — remove a function
8 DROP FUNCTION [ IF EXISTS ] name [ ( [ [ argmode ] [ argname ] argtype [, ...] ]
10 [ CASCADE | RESTRICT ]
14 DROP FUNCTION removes the definition of an existing function. To
15 execute this command the user must be the owner of the function. The
16 argument types to the function must be specified, since several
17 different functions can exist with the same name and different argument
23 Do not throw an error if the function does not exist. A notice
24 is issued in this case.
27 The name (optionally schema-qualified) of an existing function.
28 If no argument list is specified, the name must be unique in its
32 The mode of an argument: IN, OUT, INOUT, or VARIADIC. If
33 omitted, the default is IN. Note that DROP FUNCTION does not
34 actually pay any attention to OUT arguments, since only the
35 input arguments are needed to determine the function's identity.
36 So it is sufficient to list the IN, INOUT, and VARIADIC
40 The name of an argument. Note that DROP FUNCTION does not
41 actually pay any attention to argument names, since only the
42 argument data types are needed to determine the function's
46 The data type(s) of the function's arguments (optionally
47 schema-qualified), if any.
50 Automatically drop objects that depend on the function (such as
51 operators or triggers), and in turn all objects that depend on
52 those objects (see Section 5.15).
55 Refuse to drop the function if any objects depend on it. This is
60 This command removes the square root function:
61 DROP FUNCTION sqrt(integer);
63 Drop multiple functions in one command:
64 DROP FUNCTION sqrt(integer), sqrt(bigint);
66 If the function name is unique in its schema, it can be referred to
67 without an argument list:
68 DROP FUNCTION update_employee_salaries;
70 Note that this is different from
71 DROP FUNCTION update_employee_salaries();
73 which refers to a function with zero arguments, whereas the first
74 variant can refer to a function with any number of arguments, including
75 zero, as long as the name is unique.
79 This command conforms to the SQL standard, with these PostgreSQL
81 * The standard only allows one function to be dropped per command.
82 * The IF EXISTS option
83 * The ability to specify argument modes and names
87 CREATE FUNCTION, ALTER FUNCTION, DROP PROCEDURE, DROP ROUTINE