pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Csaba Nagy <nagy@ecircle-ag.com>
To: Richard Huxton <dev@archonet.com>
Cc: ON.KG <skyer@on.kg>
Cc: Postgres general mailing list <pgsql-general@postgresql.org>
Subject: Re: duplicate key violates unique constraint
Date: Mon, 13 Jun 2005 17:22:02 +0200
Message-ID: <1118676122.2720.24.camel@coppola.muc.ecircle.de> (raw)
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>

[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.






view thread (17+ messages)  latest in thread

Message-ID: <1118676122.2720.24.camel@coppola.muc.ecircle.de>
Permalink:  ../1118676122.2720.24.camel@coppola.muc.ecircle.de/
Also on:    postgresql.org/message-id/1118676122.2720.24.camel@coppola.muc.ecircle.de

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: nagy@ecircle-ag.com, dev@archonet.com, skyer@on.kg, pgsql-general@postgresql.org
  Subject: Re: duplicate key violates unique constraint
  In-Reply-To: <1118676122.2720.24.camel@coppola.muc.ecircle.de>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox