Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id D32F465AC65 for ; Tue, 16 Mar 2010 06:46:13 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 71079-03 for ; Tue, 16 Mar 2010 09:46:02 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-bw0-f221.google.com (mail-bw0-f221.google.com [209.85.218.221]) by mail.postgresql.org (Postfix) with ESMTP id 04C3765AC5D for ; Tue, 16 Mar 2010 06:46:02 -0300 (ADT) Received: by bwz21 with SMTP id 21so157467bwz.35 for ; Tue, 16 Mar 2010 02:46:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:subject:date :user-agent:mime-version:content-type:content-transfer-encoding :message-id; bh=+g+uZHqeaS3U51AjhB5oVvK4v2tf7F6wIgfl50+HFFw=; b=m3X2Loy91Lw3ny37I+ontcd5hWH6HvB5UwhOhbGhEDQPwXDfKiRWI8Pp6DA8oQZWZS 1L75jm4XRcBlTL1eDFdbHpzwaa3t7h0nX4bzPNtjFtiH5tNJ3EcG5N52ZyRyoXHKm9SW 0iEcc8y2lTBZGiGL+1vgBoiUnSzLvEnDjOitE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:date:user-agent:mime-version:content-type :content-transfer-encoding:message-id; b=R1JzCCIStRVOQwR+1BnhgypgUywL10VgfF3lARNx2Q+hJHLhUdy913FWv6qnLNq950 vJQYaOuVqtGMWfIYYbAkNDP88TAMcZApSVjDJKiF9VoyYjgPyPyBCz8j+e0E4tlfs6j3 RE0sp+IcniGLnz1cO7lgqTm/jRMVcR+a7fqtU= Received: by 10.204.18.131 with SMTP id w3mr1766729bka.16.1268732760760; Tue, 16 Mar 2010 02:46:00 -0700 (PDT) Received: from tkenner-laptop.localnet (84-119-43-229.dynamic.xdsl-line.inode.at [84.119.43.229]) by mx.google.com with ESMTPS id 13sm3472534bwz.11.2010.03.16.02.45.59 (version=SSLv3 cipher=RC4-MD5); Tue, 16 Mar 2010 02:46:00 -0700 (PDT) From: Thomas Kenner To: pgsql-sql@postgresql.org Subject: Rename Index - Deadlock Date: Tue, 16 Mar 2010 10:45:58 +0100 User-Agent: KMail/1.12.2 (Linux/2.6.31-20-generic; KDE/4.3.2; i686; ; ) MIME-Version: 1.0 Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Message-Id: <201003161045.58639.thomas.kenner@gmail.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.599 tagged_above=-10 required=5 tests=BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 201003/105 X-Sequence-Number: 33812 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