title: Drop all functions in a namespace? (Execute generated DDL commands?)
body: <p>I'm trying to write a command that will delete all functions in a namespace. I've already found a command that will generate the drop functions script:</p>
  
  <pre><code>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 = 'public'  order by proname;
  </code></pre>
  
  <p>Source: <a href="http://www.postgresonline.com/journal/archives/74-How-to-delete-many-functions.html" rel="nofollow">http://www.postgresonline.com/journal/archives/74-How-to-delete-many-functions.html</a></p>
  
  <p>This will generate something like:</p>
  
  <pre><code>                 ?column?                 
  ------------------------------------------
   DROP FUNCTION public.function1(bigint);
   DROP FUNCTION public.function2();
   DROP FUNCTION public.function3(text);
  </code></pre>
  
  <p>However, I can't figure out how to change the code, so that the functions are actually deleted - as opposed to only generating the commands.</p>
  
  <p>Any ideas?</p>