DROP ROUTINE

A DDL command to remove the definition of an existing routine

DROP ROUTINE is a  DDL command to remove the definition of an existing routine (i.e. a function or a procedure).

DROP ROUTINE was added in PostgreSQL 11.

Change history

Examples

Dropping a function:

postgres=# CREATE FUNCTION foo(INOUT bar INT) LANGUAGE SQL AS $$SELECT bar + 1;$$;
CREATE FUNCTION

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

Dropping a procedure:

postgres=# CREATE PROCEDURE foo(INOUT bar INT) LANGUAGE SQL AS $$SELECT bar + 1;$$;
CREATE PROCEDURE

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

Categories

DDL, Functions and procedures

See also

ALTER ROUTINE, DROP AGGREGATE, DROP FUNCTION, DROP PROCEDURE