pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@commandprompt.com>
To: Marcelo Costa <marcelojscosta@gmail.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: Drop All Index
Date: Mon, 27 Nov 2006 11:27:22 -0300
Message-ID: <20061127142722.GC4432@alvh.no-ip.org> (raw)
In-Reply-To: <c13f2d590611260752m29a30734p2e30c42558fd068@mail.gmail.com>
References: <c13f2d590611260752m29a30734p2e30c42558fd068@mail.gmail.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



view thread (5+ messages)  latest in thread

Message-ID: <20061127142722.GC4432@alvh.no-ip.org>
Permalink:  ../20061127142722.GC4432@alvh.no-ip.org/
Also on:    postgresql.org/message-id/20061127142722.GC4432@alvh.no-ip.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: alvherre@commandprompt.com, marcelojscosta@gmail.com
  Subject: Re: Drop All Index
  In-Reply-To: <20061127142722.GC4432@alvh.no-ip.org>
  References: <c13f2d590611260752m29a30734p2e30c42558fd068@mail.gmail.com> <20061127142722.GC4432@alvh.no-ip.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox