Received: from sss.pgh.pa.us (sss.pgh.pa.us [209.114.132.154]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id f0IL45008771 for ; Thu, 18 Jan 2001 16:04:05 -0500 (EST) (envelope-from tgl@sss.pgh.pa.us) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.1/8.11.1) with ESMTP id f0IL3vJ05104; Thu, 18 Jan 2001 16:03:58 -0500 (EST) To: Gena Gurchonok cc: pgsql-admin@postgresql.org Subject: Re: Deadlocks In-reply-to: <5220044251.20010118214926@rt.mipt.ru> References: <5220044251.20010118214926@rt.mipt.ru> Comments: In-reply-to Gena Gurchonok message dated "Thu, 18 Jan 2001 21:49:26 +0300" Date: Thu, 18 Jan 2001 16:03:57 -0500 Message-ID: <5100.979851837@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200101/121 X-Sequence-Number: 498 Gena Gurchonok writes: > CREATE INDEX "logs_id_key" on "logs" using hash ( "id" "int4_ops" ); > CREATE INDEX "logs_type_key" on "logs" using hash ( "type" "int4_ops" ); > CREATE INDEX "logs_dt_key" on "logs" using hash ( "dt" "timestamp_ops" ); > Sometimes it writes error message > "NOTICE: Deadlock detected -- See the lock(l) manual page for a possible cause." > and row of course is not inserted. > If I drop all indices on this table then such notice is not appearing. > But I need indices on this table. Don't use hash indexes; use the default index type (btree). hash indexes are subject to deadlock under concurrent insertions. Besides, they do nothing that you can't do with a btree. regards, tom lane