Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id 6C29F475992 for ; Tue, 7 May 2002 06:33:25 -0400 (EDT) Received: from mail-relay.trade-india.com (unknown [203.196.129.235]) by postgresql.org (Postfix) with SMTP id 08EA2475989 for ; Tue, 7 May 2002 06:33:21 -0400 (EDT) Received: (qmail 9722 invoked from network); 7 May 2002 10:26:43 -0000 Received: from system29.trade-india-local.com (HELO server) (192.168.0.29) by ptil-236-129-del.primus-india.net with SMTP; 7 May 2002 10:26:43 -0000 Content-Type: text/plain; charset="iso-8859-1" From: "Rajesh Kumar Mallah." Organization: Infocom Network Limited. To: "Gaetano Mendola" , Subject: Re: Delete function Date: Tue, 7 May 2002 16:02:41 +0530 X-Mailer: KMail [version 1.4] References: <009501c1f598$bb3fa8b0$d5a9fea9@GMENDOLA2> <011001c1f5b0$76ed58c0$d5a9fea9@GMENDOLA2> In-Reply-To: <011001c1f5b0$76ed58c0$d5a9fea9@GMENDOLA2> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200205071602.41096.mallah@trade-india.com> X-Archive-Number: 200205/47 X-Sequence-Number: 4222 On Tuesday 07 May 2002 03:47 pm, Gaetano Mendola wrote: > I did this but I don't know if is the correct way: > > DELETE FROM pg_proc WHERE proname ~ '^sp_'; > DELETE FROM pg_class WHERE relname ~ '^v_'; hmm.. i dont think its safe to fiddle with the system catalogs like that. There exists SQL commands for that like=20 DROP FUNCTION or DROP VIEW of course there is a limitation(read advantage) that they do not understand= =20 pattern matches but it is easy to overcome it using SQL to create a batch of SQL commands. eg regression=3D> \o command.sql regression=3D> select 'DROP function ' || proname from pg_proc WHERE pro= name=20 ~ '^sp_'; then psql -f command.sql=20 regds mallah. > > Ciao Gaetano. > > > > > ----- Original Message ----- > From: "Gaetano Mendola" > To: > Sent: Tuesday, May 07, 2002 9:28 AM > Subject: [ADMIN] Delete function > > > Hi all, > > How can I delete all function that match some name rules? > > Ex: > > I want delete all functions that matches sp_* > > and all views that matches v_* > > > > > > > > Ciao > > Gaetano > > > > -- > > #exclude > > #include > > printf("\t\t\b\b\b\b\b\b");. > > printf("\t\t\b\b\b\b\b\b"); > > > > > > ---------------------------(end of broadcast)--------------------------- > > TIP 2: you can get off all lists at once with the unregister command > > (send "unregister YourEmailAddressHere" to majordomo@postgresql.org) > > ---------------------------(end of broadcast)--------------------------- > TIP 3: if posting/reading through Usenet, please send an appropriate > subscribe-nomail command to majordomo@postgresql.org so that your > message can get through to the mailing list cleanly --=20 Rajesh Kumar Mallah, Project Manager (Development) Infocom Network Limited, New Delhi phone: +91(11)6152172 (221) (L) ,9811255597 (M) Visit http://www.trade-india.com , India's Leading B2B eMarketplace.