Re: Drop/ Alter index if exist

From: Filip Rembiałkowski <plk(dot)zuber(at)gmail(dot)com>
To: Pau Marc Munoz Torres <paumarc(at)gmail(dot)com>
Cc: pgsql general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Drop/ Alter index if exist
Date: 2009-12-22 14:01:02
Message-ID: 92869e660912220601h45113babx53d71fee47864100@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

2009/12/22 Pau Marc Munoz Torres <paumarc(at)gmail(dot)com>

> Hi every body
>

>
> there is some way to delete or rename an index only if this index exists?
>
> something like
>
> "alter index index rename to pepe if exists"
>
>
for drop - yes:
DROP INDEX IF EXISTS name;

for rename - there is no simple solution. well, actually there are solutions
but they are more complicated than the problem.
(think of user defined functions)

--
Filip Rembiałkowski
JID,mailto:filip(dot)rembialkowski(at)gmail(dot)com
http://filip.rembialkowski.net/

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Greg Smith 2009-12-22 14:19:41 Re: Not finding RPMs for 8.4.2!
Previous Message Wappler, Robert 2009-12-22 13:46:25 Re: table-valued arguments for functions