Re: UPSERT - Mailing list pgsql-hackers

From Bruno Wolff III
Subject Re: UPSERT
Date
Msg-id 20070304134658.GA14429@wolff.to
Whole thread Raw
In response to Re: UPSERT  (Hannu Krosing <hannu@skype.net>)
Responses Re: UPSERT  (Hannu Krosing <hannu@skype.net>)
Re: UPSERT  (Petr Jelinek <pjmodos@pjmodos.net>)
List pgsql-hackers
On Sun, Mar 04, 2007 at 14:55:47 +0200, Hannu Krosing <hannu@skype.net> wrote:
> 
> UPDATE
> IF NOT FOUND THEN 
>   INSERT
>   IF DUPLICATE KEY THEN
>     UPDATE
>   END IF
> END IF

I believe it is possible for the above to fail. For example another
transaction could create a matching record between the update and insert
and then another transaction could delete it between the insert and the
second update.


pgsql-hackers by date:

Previous
From: Hannu Krosing
Date:
Subject: Re: UPSERT
Next
From: Hannu Krosing
Date:
Subject: Re: UPSERT