Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 09ECAB5DBE6 for ; Wed, 18 May 2011 12:22:29 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 04391-10 for ; Wed, 18 May 2011 15:22:21 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mx01.bfk.de (mx01.bfk.de [193.227.124.2]) by mail.postgresql.org (Postfix) with ESMTP id C0115B5DBE4 for ; Wed, 18 May 2011 12:22:21 -0300 (ADT) Received: from mx00.int.bfk.de ([10.119.110.2]) by mx01.bfk.de with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) id 1QMiZn-0007Rt-6y for pgsql-admin@postgresql.org; Wed, 18 May 2011 15:22:19 +0000 Received: by bfk.de with local id 1QMiWv-0004Gs-SL for pgsql-admin@postgresql.org; Wed, 18 May 2011 15:19:21 +0000 From: Florian Weimer To: pgsql-admin@postgresql.org Subject: Deadlock during CREATE INDEX CONCURRENTLY, but index still created Date: Wed, 18 May 2011 15:19:21 +0000 Message-ID: <82k4doujd2.fsf@mid.bfk.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201105/111 X-Sequence-Number: 37548 I've run two CREATE INDEX CONCURRENTLY on the same table in parallel, and one of them errored out with: 2011-05-18 14:30:06.645 UTC bfk 23530 postgres ERROR: deadlock detected 2011-05-18 14:30:06.645 UTC bfk 23530 postgres DETAIL: Process 23530 waits for ShareLock on virtual transaction 9/28523127; blocked by process 26612. Process 26612 waits for ShareUpdateExclusiveLock on relation 229701 of database 229155; blocked by process 23530. Process 23530: CREATE INDEX CONCURRENTLY idx1 ON tbl (col1); Process 26612: CREATE INDEX CONCURRENTLY idx2 ON tbl (col); The curious thing is that both indexes were created. I would have expected that the creation of idx1 would be rolled back. Are both of the usable, or should I re-create idx1 from scratch? This is with PostgreSQL 8.4.7. (The changelog for 8.4.8 does not list anything which appears to be relevant.) --=20 Florian Weimer BFK edv-consulting GmbH http://www.bfk.de/ Kriegsstra=DFe 100 tel: +49-721-96201-1 D-76133 Karlsruhe fax: +49-721-96201-99