Re: MERGE vs REPLACE - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: MERGE vs REPLACE
Date
Msg-id 200511160022.jAG0MiC12043@candle.pha.pa.us
Whole thread Raw
In response to Re: MERGE vs REPLACE  (Simon Riggs <simon@2ndquadrant.com>)
List pgsql-hackers
Simon Riggs wrote:
> I've been looking at ways of doing INSERT then UPDATE, but it doesn't
> seem very easy to avoid unique index violations in that case. So doing
> the UPDATE first then INSERTs later seems like the way to go.

INSERT has to be first to avoid a race condition (see my previous
emails).  We just need a way to get a unique index violation and
continue with the UPDATE.  We have savepoints now so it certainly seems
possible.

--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
359-1001+  If your life is a hard drive,     |  13 Roberts Road +  Christ can be your backup.        |  Newtown Square,
Pennsylvania19073
 


pgsql-hackers by date:

Previous
From: Trent Shipley
Date:
Subject: Re: [ADMIN] Major Problem, need help! Can't run our website!
Next
From: Bruce Momjian
Date:
Subject: Re: MERGE vs REPLACE