Re: index keeps on growing - Mailing list pgsql-admin

From Tom Lane
Subject Re: index keeps on growing
Date
Msg-id 7571.1024522690@sss.pgh.pa.us
Whole thread Raw
In response to index keeps on growing  (Jean-Christophe ARNU (JX) <jc.arnu@free.fr>)
Responses Re: index keeps on growing
List pgsql-admin
Brian McCane <bmccane@mccons.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

pgsql-admin by date:

Previous
From: "Nick Fankhauser"
Date:
Subject: Re: Err Access PgAdmin
Next
From: "nimeshb"
Date:
Subject: time stamp