4 DROP ROUTINE — remove a routine
8 DROP ROUTINE [ IF EXISTS ] name [ ( [ [ argmode ] [ argname ] argtype [, ...] ]
10 [ CASCADE | RESTRICT ]
14 DROP ROUTINE removes the definition of one or more existing routines.
15 The term “routine” includes aggregate functions, normal functions, and
16 procedures. See under DROP AGGREGATE, DROP FUNCTION, and DROP PROCEDURE
17 for the description of the parameters, more examples, and further
22 The lookup rules used by DROP ROUTINE are fundamentally the same as for
23 DROP PROCEDURE; in particular, DROP ROUTINE shares that command's
24 behavior of considering an argument list that has no argmode markers to
25 be possibly using the SQL standard's definition that OUT arguments are
26 included in the list. (DROP AGGREGATE and DROP FUNCTION do not do
29 In some cases where the same name is shared by routines of different
30 kinds, it is possible for DROP ROUTINE to fail with an ambiguity error
31 when a more specific command (DROP FUNCTION, etc.) would work.
32 Specifying the argument type list more carefully will also resolve such
35 These lookup rules are also used by other commands that act on existing
36 routines, such as ALTER ROUTINE and COMMENT ON ROUTINE.
40 To drop the routine foo for type integer:
41 DROP ROUTINE foo(integer);
43 This command will work independent of whether foo is an aggregate,
44 function, or procedure.
48 This command conforms to the SQL standard, with these PostgreSQL
50 * The standard only allows one routine to be dropped per command.
51 * The IF EXISTS option is an extension.
52 * The ability to specify argument modes and names is an extension,
53 and the lookup rules differ when modes are given.
54 * User-definable aggregate functions are an extension.
58 DROP AGGREGATE, DROP FUNCTION, DROP PROCEDURE, ALTER ROUTINE
60 Note that there is no CREATE ROUTINE command.