Re: Cannot create unique index

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: Cannot create unique index
Дата
Msg-id 20030701130435.GA28181@svana.org
обсуждение исходный текст
Ответ на Re: Cannot create unique index  ("scott.marlowe" <scott.marlowe@ihs.com>)
Список pgsql-general
Unlikely. Create index takes a write lock on a table. Reindex takes an
exclusive lock (or something like that). Unless something really bad happens
it shouldn't be a problem.

I've had index corruption before. We're running 7.0 (upgrading Real Soon
Now) and there are certain situations that can corrupt indexes, mostly
involving backend segmentation faults. More recent versions should be quite
resiliant against this.

On Tue, Jul 01, 2003 at 06:50:36AM -0600, scott.marlowe wrote:
> how odd.  Since reindex works by dropping the index then recreating it, is
> it possible that some process inserted duplicates in the split second
> there was no index?
>
> for safety's sake, I've always reindexed in a transaction:
>
> begin;
> drop index bubba;
> create index bubba on ...
> commit;

--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> "the West won the world not by the superiority of its ideas or values or
> religion but rather by its superiority in applying organized violence.
> Westerners often forget this fact, non-Westerners never do."
>   - Samuel P. Huntington

Вложения

В списке pgsql-general по дате отправления:

Предыдущее
От: Yuriy Rusinov
Дата:
Сообщение: C++ functions under Windows
Следующее
От: Andrew Gould
Дата:
Сообщение: Re: Create Data Base fails