Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 4858A9FA2CA for ; Mon, 27 Nov 2006 10:48:19 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-new, port 10024) with ESMTP id 95954-10 for ; Mon, 27 Nov 2006 10:48:05 -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 BFB339FA5C8 for ; Mon, 27 Nov 2006 10:48:10 -0400 (AST) Received: by ug-out-1314.google.com with SMTP id k3so999978ugf for ; Mon, 27 Nov 2006 06:48:00 -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:content-transfer-encoding:content-disposition:references; b=bACBZoP7FkDumJ6D1vNkWN95ICcRsrVBPTXcSN6NbxFBV2cumlTPzJXZSCPEpF7VkCnnq4P3zPCDYXLTDG5VUgehYWO2NpXxpEkpjOrgZOVGqkxkASjISRnzHPLsg+BeEsmth/2yK+ykN3pvKBO6u6iLuDgp8og6kzXmg2/kG38= Received: by 10.78.39.16 with SMTP id m16mr13248346hum.1164638879785; Mon, 27 Nov 2006 06:47:59 -0800 (PST) Received: by 10.78.107.14 with HTTP; Mon, 27 Nov 2006 06:47:59 -0800 (PST) Message-ID: Date: Mon, 27 Nov 2006 14:47:59 +0000 From: "Peter Childs" To: pgsql-admin@postgresql.org Subject: Re: Drop All Index In-Reply-To: <20061127142722.GC4432@alvh.no-ip.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20061127142722.GC4432@alvh.no-ip.org> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200611/220 X-Sequence-Number: 23747 On 27/11/06, Alvaro Herrera wrote: > 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! > > -- Why do you want to? If you are going to do that you'll have problems with Primary Keys because you can't drop primary key indexes with drop index so you'll get quite a few error messages. If you want to remove them you need "alter table x drop constraint y;" Peter.