2 .\" Title: DROP ROUTINE
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 ROUTINE" "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_ROUTINE \- remove a routine
35 DROP ROUTINE [ IF EXISTS ] \fIname\fR [ ( [ [ \fIargmode\fR ] [ \fIargname\fR ] \fIargtype\fR [, \&.\&.\&.] ] ) ] [, \&.\&.\&.]
36 [ CASCADE | RESTRICT ]
41 removes the definition of one or more existing routines\&. The term
43 includes aggregate functions, normal functions, and procedures\&. See under
44 DROP AGGREGATE (\fBDROP_AGGREGATE\fR(7)),
45 DROP FUNCTION (\fBDROP_FUNCTION\fR(7)), and
46 DROP PROCEDURE (\fBDROP_PROCEDURE\fR(7))
47 for the description of the parameters, more examples, and further details\&.
50 The lookup rules used by
52 are fundamentally the same as for
53 \fBDROP PROCEDURE\fR; in particular,
55 shares that command\*(Aqs behavior of considering an argument list that has no
57 markers to be possibly using the SQL standard\*(Aqs definition that
59 arguments are included in the list\&. (\fBDROP AGGREGATE\fR
64 In some cases where the same name is shared by routines of different kinds, it is possible for
66 to fail with an ambiguity error when a more specific command (\fBDROP FUNCTION\fR, etc\&.) would work\&. Specifying the argument type list more carefully will also resolve such problems\&.
68 These lookup rules are also used by other commands that act on existing routines, such as
71 \fBCOMMENT ON ROUTINE\fR\&.
83 DROP ROUTINE foo(integer);
89 This command will work independent of whether
91 is an aggregate, function, or procedure\&.
94 This command conforms to the SQL standard, with these
106 The standard only allows one routine to be dropped per command\&.
119 option is an extension\&.
130 The ability to specify argument modes and names is an extension, and the lookup rules differ when modes are given\&.
141 User\-definable aggregate functions are an extension\&.
144 DROP AGGREGATE (\fBDROP_AGGREGATE\fR(7)), DROP FUNCTION (\fBDROP_FUNCTION\fR(7)), DROP PROCEDURE (\fBDROP_PROCEDURE\fR(7)), ALTER ROUTINE (\fBALTER_ROUTINE\fR(7))
146 Note that there is no