Re: index keeps on growing
| От | Tom Lane |
|---|---|
| Тема | Re: index keeps on growing |
| Дата | |
| Msg-id | 7571.1024522690@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | index keeps on growing (Jean-Christophe ARNU (JX) <jc.arnu@free.fr>) |
| Ответы |
Re: index keeps on growing
|
| Список | 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 по дате отправления: