Re: Cannot create unique index - Mailing list pgsql-general

From Martijn van Oosterhout
Subject Re: Cannot create unique index
Date
Msg-id 20030701130435.GA28181@svana.org
Whole thread Raw
In response to Re: Cannot create unique index  ("scott.marlowe" <scott.marlowe@ihs.com>)
List 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

Attachment

pgsql-general by date:

Previous
From: Yuriy Rusinov
Date:
Subject: C++ functions under Windows
Next
From: Andrew Gould
Date:
Subject: Re: Create Data Base fails