DROP FUNCTION

A DDL command for removing the definition of an existing function

DROP FUNCTION is a DDL command for removing the definition of an existing function.

DROP FUNCTION has always been present in PostgreSQL.

Change history

Examples

Basic DROP FUNCTION execution:

postgres=# DROP FUNCTION foo (INT);
DROP FUNCTION

Safely attempting to drop a function which might not exist:

postgres=# DROP FUNCTION IF EXISTS foo (INT);
NOTICE:  function foo(pg_catalog.int4) does not exist, skipping
DROP FUNCTION

Categories

DDL, SQL command

See also

CREATE FUNCTION, ALTER FUNCTION, DROP ROUTINE