info > DROP_ROUTINE

DROP ROUTINE(7) PostgreSQL 14.23 Documentation DROP ROUTINE(7)

πŸ“ NAME

DROP_ROUTINE - remove a routine

πŸš€ Quick Reference

Use CaseCommandDescription
Drop a single routine by nameDROP ROUTINE name;Remove an existing routine
Drop with IF EXISTSDROP ROUTINE IF EXISTS name;Remove routine if it exists, no error if missing
Drop a specific overloaded routineDROP ROUTINE name(argtype);Remove a routine with a specific argument type list
Drop with CASCADEDROP ROUTINE name CASCADE;Remove routine and dependent objects
Drop multiple routinesDROP ROUTINE name1, name2;Remove multiple routines in one command

πŸ“‹ 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. See under DROP AGGREGATE(7), DROP FUNCTION(7), and DROP PROCEDURE(7) for the description of the parameters, more examples, and further details.

πŸ“Œ 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.)

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.

βœ… COMPATIBILITY

This command conforms to the SQL standard, with these PostgreSQL extensions:

πŸ”— SEE ALSO

DROP AGGREGATE(7), DROP FUNCTION(7), DROP PROCEDURE(7), ALTER ROUTINE(7)

Note that there is no CREATE ROUTINE command.

PostgreSQL 14.23 2026 DROP ROUTINE(7)

DROP_ROUTINE
πŸ“ NAME πŸš€ Quick Reference πŸ“‹ SYNOPSIS πŸ“– DESCRIPTION πŸ“Œ NOTES πŸ’‘ EXAMPLES βœ… COMPATIBILITY πŸ”— SEE ALSO

Generated by phpman v4.9.26-5-g7740029 Author: Che Dong Under GNU General Public License
2026-08-16 09:12 @2600:1f28:365:80b0:7cb9:fb:26c1:e368
CrawledBy CCBot/2.0 (https://commoncrawl.org/faq/)
Valid XHTML 1.0 Transitional!Valid CSS!