Skip site navigation (1) Skip section navigation (2)

Re: UPSERT

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Simon Riggs" <simon(at)2ndquadrant(dot)com>
Cc: "Heikki Linnakangas" <heikki(at)enterprisedb(dot)com>, "Andrew Dunstan" <andrew(at)dunslane(dot)net>, "Jonathan Scher" <js(at)oxado(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: UPSERT
Date: 2007-03-02 18:19:58
Message-ID: 15006.1172859598@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackers
"Simon Riggs" <simon(at)2ndquadrant(dot)com> writes:
> Seems like we should try to locate a row first, then INSERT if we cannot
> find one. That's slower on INSERT but more balanced overall

Except it still has the race condition.

> I'm a bit surprised the TODO didn't mention the MERGE statement, which
> is the SQL:2003 syntax for specifying this as an atomic statement.

I believe we concluded that MERGE doesn't actually do quite what people
want/expect.  Please go back and read the archives.

			regards, tom lane

In response to

  • Re: UPSERT at 2007-03-02 18:00:09 from Simon Riggs

Responses

  • Re: UPSERT at 2007-03-02 18:39:22 from Simon Riggs
  • Re: UPSERT at 2007-03-02 19:17:46 from Josh Berkus

pgsql-hackers by date

Next:From: Bricklen AndersonDate: 2007-03-02 18:20:20
Subject: Re: UPSERT
Previous:From: Simon RiggsDate: 2007-03-02 18:00:09
Subject: Re: UPSERT

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group