info > DROP_FUNCTION

📖 NAME

DROP_FUNCTION — remove a function

🚀 Quick Reference

Use CaseCommandDescription
Drop a function by name (unique)DROP FUNCTION function_name;Removes a function when its name is unique in the schema.
Drop a function with argument typesDROP FUNCTION function_name(argument_types);Specifies the exact function signature to drop.
Drop multiple functionsDROP FUNCTION func1(type), func2(type);Removes several functions in one command.
Drop with IF EXISTSDROP FUNCTION IF EXISTS function_name;Suppresses error if the function does not exist.
Drop with CASCADEDROP FUNCTION function_name CASCADE;Automatically drops dependent objects.
Drop with RESTRICTDROP FUNCTION function_name RESTRICT;Refuses drop if any objects depend on it (default).

📝 SYNOPSIS

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

📖 DESCRIPTION

DROP FUNCTION removes the definition of an existing function. To execute this command the user must be the owner of the function. The argument types to the function must be specified, since several different functions can exist with the same name and different argument lists.

⚙️ PARAMETERS

💡 EXAMPLES

This command removes the square root function:

DROP FUNCTION sqrt(integer);

Drop multiple functions in one command:

DROP FUNCTION sqrt(integer), sqrt(bigint);

If the function name is unique in its schema, it can be referred to without an argument list:

DROP FUNCTION update_employee_salaries;

Note that this is different from

DROP FUNCTION update_employee_salaries();

which refers to a function with zero arguments, whereas the first variant can refer to a function with any number of arguments, including zero, as long as the name is unique.

🔗 COMPATIBILITY

This command conforms to the SQL standard, with these PostgreSQL extensions:

📚 SEE ALSO

📄 CREATE FUNCTION(7), ALTER FUNCTION(7), DROP PROCEDURE(7), DROP ROUTINE(7)

DROP_FUNCTION
📖 NAME 🚀 Quick Reference 📝 SYNOPSIS 📖 DESCRIPTION ⚙️ PARAMETERS 💡 EXAMPLES 🔗 COMPATIBILITY 📚 SEE ALSO

Generated by phpman v4.9.26-5-g7740029 Author: Che Dong Under GNU General Public License
2026-08-16 09:06 @2600:1f28:365:80b0:7cb9:fb:26c1:e368
CrawledBy CCBot/2.0 (https://commoncrawl.org/faq/)
Valid XHTML 1.0 Transitional!Valid CSS!