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

Re: REPLACE INTO table a la mySQL

From: mlw <markw(at)mohawksoft(dot)com>
To: Dale Johnson <djohnson(at)mi(dot)ab(dot)ca>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: REPLACE INTO table a la mySQL
Date: 2001-06-05 22:26:22
Message-ID: 3B1D5C8E.5C5DF552@mohawksoft.com (view raw or flat)
Thread:
Lists: pgsql-hackers
Dale Johnson wrote:
> 
> I know we're not in the business of copying mySQL,
> but the REPLACE INTO table (...) values (...) could be
> a useful semantic.  This is a combination INSERT or
> UPDATE statement.  For one thing, it is atomic, and
> easier to work with at the application level.  Also
> if the application doesn't care about previous values,
> then execution has fewer locking issues and race
> conditions.
> 
> comments?
> 
> Dale Johnson

I don't know if it is standard SQL, but it will save hundreds of lines of code
in applications everywhere. I LOVE the idea. I just finished writing a database
merge/update program which could have been made much easier to write with this
syntax.

In response to

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2001-06-05 22:58:22
Subject: Re: BLOBs
Previous:From: Tom LaneDate: 2001-06-05 22:13:41
Subject: Re: Acucobol interface

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