Synopsis

Use the DROP FUNCTION statement to remove a function from a database.

Syntax

drop_function ::= DROP { FUNCTION | PROCEDURE } [ IF EXISTS ]  
                  { name [ ( [ argtype_decl [ , ... ] ] ) ] } 
                  [ , ... ] [ CASCADE | RESTRICT ]

argtype_decl ::= [ argmode ] [ argname ] argtype

drop_function

DROPFUNCTIONPROCEDUREIFEXISTS,name(,argtype_decl)CASCADERESTRICT

argtype_decl

argmodeargnameargtype

Semantics

  • An error will be thrown if the function does not exist unless IF EXISTS is used. Then a notice is issued instead.

  • RESTRICT is the default and it will not drop the function if any objects depend on it.

  • CASCADE will drop any objects that transitively depend on the function.

Examples

DROP FUNCTION IF EXISTS inc(i integer), mul(integer, integer) CASCADE;

See also