X-Original-To: pgsql-sql-postgresql.org@postgresql.org Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id D99089FB24D for ; Thu, 24 Aug 2006 15:36:20 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 59402-08 for ; Thu, 24 Aug 2006 18:36:02 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey- Received: from jive.SoftHome.net (jive.SoftHome.net [66.54.152.27]) by postgresql.org (Postfix) with SMTP id C0E439FB287 for ; Thu, 24 Aug 2006 15:36:01 -0300 (ADT) Received: (qmail 22009 invoked by uid 417); 24 Aug 2006 18:36:00 -0000 Received: from tango-.softhome.net (HELO softhome.net) (172.16.2.14) by shunt-smtp-com-out-com-0 with SMTP; 24 Aug 2006 18:36:00 -0000 Received: from [10.27.93.50] ([209.163.142.248]) (AUTH: PLAIN scottpetersen@softhome.net) by softhome.net with esmtp; Thu, 24 Aug 2006 12:35:58 -0600 Message-ID: <44EDF18D.4000605@softhome.net> Date: Thu, 24 Aug 2006 12:35:57 -0600 From: Scott Petersen User-Agent: Thunderbird 1.5.0.5 (Windows/20060719) MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: Re: Deleting Functions References: <44ECAC88.4060208@softhome.net> <20060823195430.M44644@contactbda.com> In-Reply-To: <20060823195430.M44644@contactbda.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=3.816 tagged_above=0 required=5 tests=SPF_HELO_SOFTFAIL, SPF_SOFTFAIL X-Spam-Level: *** X-Archive-Number: 200608/185 X-Sequence-Number: 26143 Thanks for those who responded. It works fine and lasts a long time. The following script does NOT require any editing. It simply executes and works. \pset format unaligned \pset fieldsep '' \pset footer \t \o drops.sql select 'drop function ' || nspname || '.' || proname || '(' || pg_catalog.oidvectortypes(p.proargtypes) || ') CASCADE;' from pg_proc p join pg_namespace b on (p.pronamespace=b.oid) where nspname='public'; \o \i drops.sql Scott. Jim Buttafuoco wrote: > Scott, > > I use the following query with psql \o option. Change the schema name from public to whatever. I am sure you could put > this into a plpgsql function using execute as well. > > > Jim > > \o drops.sql > select 'drop function ' || nspname || '.' || proname || '(' || pg_catalog.oidvectortypes(p.proargtypes) || ');' from > pg_proc p join pg_namespace b on (p.pronamespace=b.oid) where nspname='public'; > \o > \!vi drops.sql # < \i drops.sql > > > > >