DROP_ROUTINE(7pg17)
π NAME π
DROP_ROUTINE β remove a routine. Okay bestie, you're on the DROP ROUTINE(7) manual page, and this is the whole mood: remove a routine. That's it. That's the assignment. β¨
π«Ά SYNOPSIS π«Ά
DROP ROUTINE [ IF EXISTS ] name [ ( [ [ argmode ] [ argname ] argtype [, ...] ] ) ] [, ...]
[ CASCADE | RESTRICT ]
π DESCRIPTION π
DROP ROUTINE removes the definition of one or more existing routines. The term βroutineβ includes aggregate functions, normal functions, and procedures β yes, all three, no cap. For the description of the parameters, more examples, and further details, peek under DROP AGGREGATE (DROP_AGGREGATE(7)), DROP FUNCTION (DROP_FUNCTION(7)), and DROP PROCEDURE (DROP_PROCEDURE(7)). π«Ά
π§ NOTES π§
The lookup rules used by DROP ROUTINE are fundamentally the same as for DROP PROCEDURE; in particular, DROP ROUTINE shares that command's behavior of considering an argument list that has no argmode markers to be possibly using the SQL standard's definition that OUT arguments are included in the list. (DROP AGGREGATE and DROP FUNCTION do not do that.) Important little lookup-lore moment, bestie. π
In some cases where the same name is shared by routines of different kinds, it is possible for DROP ROUTINE to fail with an ambiguity error when a more specific command (DROP FUNCTION, etc.) would work. Specifying the argument type list more carefully will also resolve such problems. π¦
These lookup rules are also used by other commands that act on existing routines, such as ALTER ROUTINE and COMMENT ON ROUTINE.
π EXAMPLES π
To drop the routine foo for type integer:
DROP ROUTINE foo(integer);
This command will work independent of whether foo is an aggregate, function, or procedure. Periodt. π
π COMPATIBILITY π
This command conforms to the SQL standard, with these PostgreSQL extensions:
- The standard only allows one routine to be dropped per command.
- The
IF EXISTSoption is an extension. - The ability to specify argument modes and names is an extension, and the lookup rules differ when modes are given.
- User-definable aggregate functions are an extension.
π¦ SEE ALSO π¦
DROP AGGREGATE(DROP_AGGREGATE(7))DROP FUNCTION(DROP_FUNCTION(7))DROP PROCEDURE(DROP_PROCEDURE(7))ALTER ROUTINE(ALTER_ROUTINE(7))
Note that there is no CREATE ROUTINE command. Like, none. Not a vibe, just facts. π
π That's the whole DROP ROUTINE(7) situation, bestie β PostgreSQL 17.11 docs, dated 2026, signing off with sparkles. π
π¦ where this page comes from
- opensuse-leap 16.0: postgresql17 17.11-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql17 17.11-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql17 17.11-160000.1.1 Β· PostgreSQL
- opensuse-leap 16.0: postgresql17 17.11-160000.1.1 Β· PostgreSQL
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms