Re: index keeps on growing

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Brian McCane <bmccane(at)mccons(dot)net>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: index keeps on growing
Date: 2002-06-19 21:38:10
Message-ID: 7571.1024522690@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Brian McCane <bmccane(at)mccons(dot)net> writes:
> I assume that if I do it in a BEGIN..COMMIT block I won't lose
> anything, but I am not sure if a "DROP INDEX" can be rolled back.

DROP INDEX can be rolled back in the same releases that allow DROP
TABLE to be rolled back. I think we allowed that beginning in
7.0, but check the release notes.

So basically you'd want

BEGIN;
DROP INDEX foo;
either CREATE INDEX ...
or ALTER TABLE ADD PRIMARY KEY ...;
COMMIT;

Note this will imply peak disk usage equal to size of old index
plus size of new, since the old file can't physically be removed
till commit.

regards, tom lane

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message nimeshb 2002-06-19 22:28:38 time stamp
Previous Message Nick Fankhauser 2002-06-19 19:55:02 Re: Err Access PgAdmin