Rename Index - Deadlock

From: Thomas Kenner <thomas(dot)kenner(at)gmail(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Rename Index - Deadlock
Date: 2010-03-16 09:45:58
Message-ID: 201003161045.58639.thomas.kenner@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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.

The index contains a foreign key (don't know if this information is
important).

Is this a known issue?

Thanks,
Thomas

--
Thomas Kenner

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Dmitriy Igrishin 2010-03-16 09:59:07 SQL code beautifier for PostgreSQL.
Previous Message Dmitriy Igrishin 2010-03-16 09:39:42 DROP RULE ... CASCADE