Re: Rename Index - Deadlock

From: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
To: Thomas Kenner <thomas(dot)kenner(at)gmail(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Rename Index - Deadlock
Date: 2010-03-16 16:39:37
Message-ID: dcc563d11003160939q56bf00e3p4516c0a98a57dad6@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Tue, Mar 16, 2010 at 3:45 AM, Thomas Kenner <thomas(dot)kenner(at)gmail(dot)com> wrote:
> Hi,
>
> Each day I'm recreating the index my_index of the table my_table. Therefore I
> create a new index my_index_new, drop the old index my_index, and rename the
> new index:
> ALTER INDEX my_index_new RENAME TO my_index;
>
> If an insert or select statement is run at the same time as the "ALTER INDEX
> ... RENAME TO" statement, it will end up in a deadlock.

A deadlock or just a lock? What version of pg? What exact error
messages do you get?

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Rob Sargent 2010-03-16 18:08:58 Re: installing uuid generators
Previous Message Tom Lane 2010-03-16 16:16:04 Re: Rename Index - Deadlock