]> begriffs open source - ai-pg/blob - full-docs/txt/sql-droproutine.txt
Convert HTML docs to more streamlined TXT
[ai-pg] / full-docs / txt / sql-droproutine.txt
1
2 DROP ROUTINE
3
4    DROP ROUTINE — remove a routine
5
6 Synopsis
7
8 DROP ROUTINE [ IF EXISTS ] name [ ( [ [ argmode ] [ argname ] argtype [, ...] ]
9 ) ] [, ...]
10     [ CASCADE | RESTRICT ]
11
12 Description
13
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
18    details.
19
20 Notes
21
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
27    that.)
28
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
33    problems.
34
35    These lookup rules are also used by other commands that act on existing
36    routines, such as ALTER ROUTINE and COMMENT ON ROUTINE.
37
38 Examples
39
40    To drop the routine foo for type integer:
41 DROP ROUTINE foo(integer);
42
43    This command will work independent of whether foo is an aggregate,
44    function, or procedure.
45
46 Compatibility
47
48    This command conforms to the SQL standard, with these PostgreSQL
49    extensions:
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.
55
56 See Also
57
58    DROP AGGREGATE, DROP FUNCTION, DROP PROCEDURE, ALTER ROUTINE
59
60    Note that there is no CREATE ROUTINE command.