Amazon Redshift
Database Developer Guide (API Version 2012-12-01)


Removes a user-defined function (UDF) from the database. The function's signature, or list of argument data types, must be specified because multiple functions can exist with the same name but different signatures. You cannot drop an Amazon Redshift built-in function.

This command is not reversible.


DROP FUNCTION name ( [arg_name] arg_type [, ...] ) [ CASCADE | RESTRICT ]



The name of the function to be removed.


The name of an input argument. DROP FUNCTION ignores argument names, because only the argument data types are needed to determine the function's identity.


The data type of the input argument. You can supply a comma-separated list with a maximum of 32 data types.


Keyword specifying to automatically drop objects that depend on the function, such as views.

To create a view that is not dependent on a function, include the WITH NO SCHEMA BINDING clause in the view definition. For more information, see CREATE VIEW.


Keyword specifying that if any objects depend on depend on the function, do not drop the function and return a message. This action is the default.


The following example drops the function named f_sqrt:

drop function f_sqrt(int);

To remove a function that has dependencies, use the CASCADE option, as shown in the following example:

drop function f_sqrt(int)cascade;

On this page: