PostgreSQL: Populate DROP FUNCTION script with the type of Parameters

In the PostgreSQL, If you want to drop a function, you have to also mention the type of the parameters.

In this post, I am providing one script to populate DROP FUNCTION script with all the type of parameters.

For example:

One function definition is,
CREATE FUNCTION fn_test (id integer, name character varying);

You cannot drop this function using just DROP FUNCTION like,
DROP FUNCTION fn_test();

You have to also specify the type of the parameters like,
DROP FUNCTION fn_test(integer, character varying);

If we are going to drop multiple function, we require to prepare drop function script for each and every function by specifying the type of input parameters.

Here, I am sharing one script to solve this problem and using this script you can get a full DROP FUNCTION script with the type of input parameters. You can select the require drop function script and execute it.

Anvesh Patel

Leave a Reply

Be the First to Comment!

Notify of
avatar
wpDiscuz