Re: deadlock while re-indexing table

From: Dave Cramer <pg(at)fastcrypt(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Gregory Stark <stark(at)enterprisedb(dot)com>, "Alvaro Herrera" <alvherre(at)commandprompt(dot)com>, "Postgres General" <pgsql-general(at)postgresql(dot)org>
Subject: Re: deadlock while re-indexing table
Date: 2008-02-12 22:28:48
Message-ID: 85FF389A-1FF8-4C15-A3AD-C113B89D5329@fastcrypt.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On 12-Feb-08, at 5:05 PM, Tom Lane wrote:

> Dave Cramer <pg(at)fastcrypt(dot)com> writes:
>>>> The other process is inserting into the user_profile table.
>>>
>>> Did either transaction do anything else in the same transaction
>>> previously?
>>>
>> It would appear that the insert is running before the reindex starts.
>
> That's not possible --- if it had been, the insert would already have
> RowExclusiveLock on the table, which would have blocked the reindex
> from acquiring ShareLock on the table. The reindex must already have
> that, since it's trying to acquire AccessExclusiveLock on one of the
> indexes, so there can't be any active inserts on the table.
>
> I suspect the other process must be doing a series of selects in one
> transaction that use indexes of the table in some random order, but
> that's just an educated guess at this point.
>
> BTW, what PG version is this?
>
8.2.5

Dave
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Koen Vermeer 2008-02-12 22:41:15 Storing images as BYTEA or large objects
Previous Message Tom Lane 2008-02-12 22:13:15 Re: [GENERAL] end of life for pg versions...