]> begriffs open source - ai-pg/blob - full-docs/man7/DROP_ROUTINE.7
Convert HTML docs to more streamlined TXT
[ai-pg] / full-docs / man7 / DROP_ROUTINE.7
1 '\" t
2 .\"     Title: DROP ROUTINE
3 .\"    Author: The PostgreSQL Global Development Group
4 .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
5 .\"      Date: 2025
6 .\"    Manual: PostgreSQL 18.0 Documentation
7 .\"    Source: PostgreSQL 18.0
8 .\"  Language: English
9 .\"
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 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
18 .ie \n(.g .ds Aq \(aq
19 .el       .ds Aq '
20 .\" -----------------------------------------------------------------
21 .\" * set default formatting
22 .\" -----------------------------------------------------------------
23 .\" disable hyphenation
24 .nh
25 .\" disable justification (adjust text to left margin only)
26 .ad l
27 .\" -----------------------------------------------------------------
28 .\" * MAIN CONTENT STARTS HERE *
29 .\" -----------------------------------------------------------------
30 .SH "NAME"
31 DROP_ROUTINE \- remove a routine
32 .SH "SYNOPSIS"
33 .sp
34 .nf
35 DROP ROUTINE [ IF EXISTS ] \fIname\fR [ ( [ [ \fIargmode\fR ] [ \fIargname\fR ] \fIargtype\fR [, \&.\&.\&.] ] ) ] [, \&.\&.\&.]
36     [ CASCADE | RESTRICT ]
37 .fi
38 .SH "DESCRIPTION"
39 .PP
40 \fBDROP ROUTINE\fR
41 removes the definition of one or more existing routines\&. The term
42 \(lqroutine\(rq
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\&.
48 .SH "NOTES"
49 .PP
50 The lookup rules used by
51 \fBDROP ROUTINE\fR
52 are fundamentally the same as for
53 \fBDROP PROCEDURE\fR; in particular,
54 \fBDROP ROUTINE\fR
55 shares that command\*(Aqs behavior of considering an argument list that has no
56 \fIargmode\fR
57 markers to be possibly using the SQL standard\*(Aqs definition that
58 OUT
59 arguments are included in the list\&. (\fBDROP AGGREGATE\fR
60 and
61 \fBDROP FUNCTION\fR
62 do not do that\&.)
63 .PP
64 In some cases where the same name is shared by routines of different kinds, it is possible for
65 \fBDROP ROUTINE\fR
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\&.
67 .PP
68 These lookup rules are also used by other commands that act on existing routines, such as
69 \fBALTER ROUTINE\fR
70 and
71 \fBCOMMENT ON ROUTINE\fR\&.
72 .SH "EXAMPLES"
73 .PP
74 To drop the routine
75 foo
76 for type
77 integer:
78 .sp
79 .if n \{\
80 .RS 4
81 .\}
82 .nf
83 DROP ROUTINE foo(integer);
84 .fi
85 .if n \{\
86 .RE
87 .\}
88 .sp
89 This command will work independent of whether
90 foo
91 is an aggregate, function, or procedure\&.
92 .SH "COMPATIBILITY"
93 .PP
94 This command conforms to the SQL standard, with these
95 PostgreSQL
96 extensions:
97 .sp
98 .RS 4
99 .ie n \{\
100 \h'-04'\(bu\h'+03'\c
101 .\}
102 .el \{\
103 .sp -1
104 .IP \(bu 2.3
105 .\}
106 The standard only allows one routine to be dropped per command\&.
107 .RE
108 .sp
109 .RS 4
110 .ie n \{\
111 \h'-04'\(bu\h'+03'\c
112 .\}
113 .el \{\
114 .sp -1
115 .IP \(bu 2.3
116 .\}
117 The
118 IF EXISTS
119 option is an extension\&.
120 .RE
121 .sp
122 .RS 4
123 .ie n \{\
124 \h'-04'\(bu\h'+03'\c
125 .\}
126 .el \{\
127 .sp -1
128 .IP \(bu 2.3
129 .\}
130 The ability to specify argument modes and names is an extension, and the lookup rules differ when modes are given\&.
131 .RE
132 .sp
133 .RS 4
134 .ie n \{\
135 \h'-04'\(bu\h'+03'\c
136 .\}
137 .el \{\
138 .sp -1
139 .IP \(bu 2.3
140 .\}
141 User\-definable aggregate functions are an extension\&.
142 .RE
143 .SH "SEE ALSO"
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))
145 .PP
146 Note that there is no
147 CREATE ROUTINE
148 command\&.