DROP TEMPORARY FUNCTION

Drops a temporary function within the current transaction.

Syntax

DROP TEMPORARY FUNCTION IF EXISTS functionName
DROP TEMPORARY FUNCTION [IF EXISTS] function_name

Parameters

IF EXISTS

If specified, the statement is a no-op when the named temporary function does not exist. Without this clause, dropping a non-existent function raises an error.

function_name

The name of the temporary function to drop. Must be a temporary function created in the current transaction.

Examples

Drop an existing temporary function:

DROP TEMPORARY FUNCTION my_temp_func

Drop a temporary function without error if it does not exist:

DROP TEMPORARY FUNCTION IF EXISTS my_temp_func

Important Notes

Temporary functions are automatically dropped when the transaction commits. DROP TEMPORARY FUNCTION allows earlier removal within the same transaction — for example, to free the name for redefinition without using OR REPLACE.

See Also