DROP FUNCTION

Delete the function.

Summary

DROP FUNCTION [IF EXISTS] name ( [ [argmode] [argname] argtype
                [, ...] ] ) [CASCADE | RESTRICT]

describe

DROP FUNCTION deletes the definition of an existing function. To execute this command, the user must be the owner of the function. The parameter type of the function must be specified, because there may be multiple different functions with the same name and different parameter lists.

Parameters

IF EXISTS

  • If the function does not exist, please do not report an error. In this case, a notification will be issued.

name

  • The name of the existing function (can be specified by the pattern).

argmode

  • Parameter mode: IN, OUT, INOUT or VARIADIC. If omitted, the default value is IN. Note that DROP FUNCTION does not actually focus on the OUT parameters since only input parameters are required to determine the identification of the function. Therefore, listing the IN, INOUT and VARIADIC parameters is sufficient.

argname

  • The name of the parameter. Note that DROP FUNCTION does not actually focus on parameter names since only parameter data types are required to determine the identification of the function.

argtype

  • The data type of the function parameter (can be specified by the pattern) (if any).

CASCADE

  • Automatically delete objects that depend on functions, such as operators.

RESTRICT

  • If any object depends on the function, the function is denied. This is the default value.

Example

Delete the square root function:

DROP FUNCTION sqrt(integer);

compatibility

The DROP FUNCTION statement is defined in the SQL standard, but this command is incompatible with this command.

See also

ALTER FUNCTION , CREATE FUNCTION