Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 025759FA2F5 for ; Mon, 27 Nov 2006 12:37:06 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-new, port 10024) with ESMTP id 86865-03 for ; Mon, 27 Nov 2006 12:36:45 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.171]) by postgresql.org (Postfix) with ESMTP id F03E49FB1F8 for ; Mon, 27 Nov 2006 12:36:44 -0400 (AST) Received: by ug-out-1314.google.com with SMTP id k3so1033333ugf for ; Mon, 27 Nov 2006 08:36:42 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=SNCOcx12+aW6l2lmQjLZ8E4fuw/jpwjfU6T2dfxwO/e1bfjR3vzLNYxlA4IiVlBNv5E7xv6eiOK1EmU0aMNMlOXfeA1BSD/ZhL9hA5u1LyrDeUpLDqG8tfmIsIKOdvZdcdIczXYUYOtKTnAtbFT+Ndu/cbTht5XSw1YGttf8Px0= Received: by 10.66.244.10 with SMTP id r10mr12720646ugh.1164645401815; Mon, 27 Nov 2006 08:36:41 -0800 (PST) Received: by 10.66.223.9 with HTTP; Mon, 27 Nov 2006 08:36:41 -0800 (PST) Message-ID: Date: Mon, 27 Nov 2006 13:36:41 -0300 From: "Marcelo Costa" To: "Marcelo Costa" , pgsql-admin@postgresql.org Subject: Re: Drop All Index In-Reply-To: <20061127142722.GC4432@alvh.no-ip.org> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_5592_21694111.1164645401396" References: <20061127142722.GC4432@alvh.no-ip.org> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200611/222 X-Sequence-Number: 23749 ------=_Part_5592_21694111.1164645401396 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi, Alvaro, thanks, I make a function to do this. [],s Marcelo. 2006/11/27, Alvaro Herrera : > > Marcelo Costa wrote: > > Hi to all, > > > > Anybody can help me how to proced to delete all index from my database, > > exists any command to this ? > > Sure, you can create a PL/pgSQL function that loops around a "select > relname from pg_class where relkind='i' AND ..." and then issues DROP > INDEX for each (or you can do it in shell). Be careful to include a > clause to select only indexes that are not in system catalogs! > > -- > Alvaro Herrera > http://www.CommandPrompt.com/ > PostgreSQL Replication, Consulting, Custom Development, 24x7 support > -- Marcelo Costa ------=_Part_5592_21694111.1164645401396 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi, Alvaro, thanks, I make a function to do this.

[],s

Marcelo.

2006/11/27, Alvaro Herrera <alvherre@commandprompt.com>:
Marcelo Costa wrote:
> Hi to all,
>
> Anybody can help me how to proced to delete all index from my database,
> exists any command to this ?

Sure, you can create a PL/pgSQL function that loops around a "select
relname from pg_class where relkind='i' AND ..." and then issues DROP
INDEX for each (or you can do it in shell).  Be careful to include a
clause to select only indexes that are not in system catalogs!

--
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support



--
Marcelo Costa ------=_Part_5592_21694111.1164645401396--