Last Updated: February 25, 2016
·
585
· Aeon

how to drop functions in psql if you do not know the arguments?

run

SELECT 'DROP FUNCTION ' || quote_ident(ns.nspname) || '.' || quote_ident(proname) || '(' || oidvectortypes(proargtypes) || ');'
FROM pg_proc INNER JOIN pg_namespace ns ON (pg_proc.pronamespace = ns.oid)
WHERE ns.nspname = 'my_messed_up_schema' order by proname;

and that should generate correct DROP statements that you can just paste into psql shell.