Re: Hard problem with concurrency

From: Vincent van Leeuwen <pgsql(dot)spam(at)vinz(dot)nl>
To: Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Hard problem with concurrency
Date: 2003-02-18 23:27:18
Message-ID: 20030218232718.GN29874@md2.mediadesign.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2003-02-18 20:02:29 +0100, Peter Eisentraut wrote:
> Christopher Kings-Lynne writes:
>
> > REPLACE INTO anyone? ;)
>
> The upcoming SQL 200x standard includes a MERGE command that appears to
> fulfill that purpose.
>

MySQL features a poor-mans aproach to this problem, their REPLACE command:

http://www.mysql.com/doc/en/REPLACE.html
REPLACE works exactly like INSERT, except that if an old record in the table
has the same value as a new record on a UNIQUE index or PRIMARY KEY, the old
record is deleted before the new record is inserted.

I'd love to see this kind of functionality in PG, I've got a database that
caches data which only gets conditional INSERT/UPDATEs, so that would save a
lot of wasted SQL commands.

Vincent van Leeuwen
Media Design

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ross J. Reedstrom 2003-02-18 23:55:45 Re: psql and readline
Previous Message Peter Eisentraut 2003-02-18 23:10:06 Re: Hard problem with concurrency