DROP PROCEDURE

Synopsis

Use the DROP PROCEDURE statement to remove a procedure from a database.

Syntax

  1. drop_procedure ::= DROP PROCEDURE [ IF EXISTS ]
  2. { name [ ( [ argtype_decl [ , ... ] ] ) ] }
  3. [ , ... ] [ CASCADE | RESTRICT ]
  4. argtype_decl ::= [ argmode ] [ argname ] argtype

drop_procedure

DROP PROCEDURE - 图1

argtype_decl

DROP PROCEDURE - 图2

Semantics

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

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

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

Examples

  1. DROP PROCEDURE IF EXISTS transfer(integer, integer, dec) CASCADE;

See also