Contents
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
- PostgreSQL 8.2
DROP FUNCTION IF EXISTS ...
syntax added (commit bbcd0169)
- PostgreSQL 8.1
- support for
IN
/OUT
/INOUT
parameters (initial commit 47888fe8)
- support for
- PostgreSQL 7.3
CASCADE
andRESTRICT
clauses added (commit 7c6df91d)
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
References
- PostgreSQL documentation: DROP FUNCTION