Drop all indexes of a table w/o knowing the index names

From: Giulio Orsero <giulioo(at)pobox(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Drop all indexes of a table w/o knowing the index names
Date: 2004-11-09 14:40:39
Message-ID: 20041109144039.1B2D313346@mail.golden.dom
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

7.4.6 on Linux.

I need a way to drop all indexes of a table without knowing the names of the
indexes.

Say I have a table

table1
index1
index2
index3

I don't want to do

drop index1;
drop index2;
drop index3;

but I want

drop <all indexes of table table1>

is this possible? I looked in the manual at pg_index, but couldn't build an
sql string to do it.

Thanks

--
giulioo(at)pobox(dot)com

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message T E Schmitz 2004-11-09 14:46:02 Re: tricky GROUP BY / JOIN question
Previous Message Michael Fuhr 2004-11-09 13:55:01 Re: A transaction in transaction? Possible?