Re: INSERT...ON DUPLICATE KEY LOCK FOR UPDATE

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Peter Geoghegan <pg(at)heroku(dot)com>, Andres Freund <andres(at)2ndquadrant(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: INSERT...ON DUPLICATE KEY LOCK FOR UPDATE
Date: 2013-10-15 17:58:28
Message-ID: 525D8244.10909@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 10/15/2013 08:11 AM, Robert Haas wrote:
> I'm not saying "go implement MERGE". I'm saying, make the
> insert-or-update operation a single statement, using some syntax TBD,
> instead of requiring the use of a new insert statement that makes
> invisible rows visible as a side effect, so that you can wrap that in
> a CTE and feed it to an update statement. That's complex and, AFAICS,
> unlike how any other database product handles this.

Hmmm. Is the plan NOT to eventually get to a single-statement upsert?
If not, then I'm not that keen on this feature. I can't say that
anybody I know who's migrating from MySQL would use a 2-statement
version of upsert; if they were prepared for that, then they'd be
prepared to just rewrite their stuff as proper insert/updates anyway.

--
Josh Berkus
PostgreSQL Experts Inc.
http://pgexperts.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2013-10-15 18:05:09 Re: INSERT...ON DUPLICATE KEY LOCK FOR UPDATE
Previous Message Peter Geoghegan 2013-10-15 17:53:35 Re: INSERT...ON DUPLICATE KEY LOCK FOR UPDATE