Re: Duplicate key insert question

From: Jean-Christian Imbeault <jc(at)mega-bucks(dot)co(dot)jp>
To: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Duplicate key insert question
Date: 2003-07-02 01:43:48
Message-ID: 3F0238D4.1030307@mega-bucks.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Alvaro Herrera wrote:
>
> Well, he is right. One will fail, the other will not. The race
> condition is for the application. If you want to ignore it, you can do
> that, but there _will_ be an ERROR thrown and the transaction will be
> aborted.

Ah ... then maybe this solution is 'good enough'. It will still generate
an error message some of the time (when there is a race condition) but
will definitely generate fewer error messages than the current method
used which is just to do the insert and let it fail if there is already
a record with the same primary key.

Thanks for the help!

Jean-Christian Imbeault

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Dann Corbit 2003-07-02 01:48:29 Re: Duplicate key insert question
Previous Message Alvaro Herrera 2003-07-02 01:43:03 Re: Duplicate key insert question