X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id AE47C528E0 for ; Mon, 13 Jun 2005 12:22:54 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 51105-01 for ; Mon, 13 Jun 2005 15:22:45 +0000 (GMT) Received: from mail.ecircle.de (mail.ecircle.de [195.140.186.200]) by svr1.postgresql.org (Postfix) with ESMTP id 9575352862 for ; Mon, 13 Jun 2005 12:22:42 -0300 (ADT) Received: from [192.168.1.110] (unknown [192.168.1.110]) by mail.ecircle.de (READY) with ESMTP id 2288455D759; Mon, 13 Jun 2005 17:22:42 +0200 (CEST) Subject: Re: duplicate key violates unique constraint From: Csaba Nagy To: Richard Huxton Cc: "ON.KG" , Postgres general mailing list In-Reply-To: <42AD9B9D.6080902@archonet.com> References: <42A95936.3060002@archonet.com> <20050610095655.0215752956@svr1.postgresql.org> <10813889593.20050613202239@on.kg> <42AD9B9D.6080902@archonet.com> Content-Type: text/plain Message-Id: <1118676122.2720.24.camel@coppola.muc.ecircle.de> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 (1.4.6-2) Date: Mon, 13 Jun 2005 17:22:02 +0200 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.021 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200506/626 X-Sequence-Number: 79334 [snip] > If you have more than one client, this can always happen. You have two > choices: > 1. Use a lock to stop two clients interacting like this This won't work unless you make all the clients serialized, or you have all the ip's already inserted in the data base... you can't lock on an unknown key, otherwise the locking will also need to insert, and you're back to the same race condition ;-) Cheers, Csaba.