Skip to content

Instantly share code, notes, and snippets.

@willgarcia
Created March 3, 2014 15:46
Show Gist options
  • Select an option

  • Save willgarcia/1581244e7dea82bd4c85 to your computer and use it in GitHub Desktop.

Select an option

Save willgarcia/1581244e7dea82bd4c85 to your computer and use it in GitHub Desktop.
drop all functions pg (per sschema)
SELECT 'DROP FUNCTION ' || ns.nspname || '.' || 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;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment