Re: duplicate key violates unique constraint

From: Csaba Nagy <nagy(at)ecircle-ag(dot)com>
To: Richard Huxton <dev(at)archonet(dot)com>
Cc: "ON(dot)KG" <skyer(at)on(dot)kg>, Postgres general mailing list <pgsql-general(at)postgresql(dot)org>
Subject: Re: duplicate key violates unique constraint
Date: 2005-06-13 15:22:02
Message-ID: 1118676122.2720.24.camel@coppola.muc.ecircle.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-sql

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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Chris Browne 2005-06-13 15:42:55 Re: PostgreSQL Certification
Previous Message Scott Marlowe 2005-06-13 15:14:35 Re: mirroring oracle database in pgsql

Browse pgsql-sql by date

  From Date Subject
Next Message Richard Huxton 2005-06-13 15:49:15 Re: duplicate key violates unique constraint
Previous Message Csaba Nagy 2005-06-13 14:45:41 Re: duplicate key violates unique constraint