Re: SQL MERGE patches for PostgreSQL Versions

From: Peter Geoghegan <pg(at)bowt(dot)ie>
To: Jan de Visser <jan(at)de-visser(dot)net>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, bxzhai2010(at)gmail(dot)com, Kang Yuzhe <tiggreen87(at)gmail(dot)com>
Subject: Re: SQL MERGE patches for PostgreSQL Versions
Date: 2017-06-22 17:08:34
Message-ID: CAH2-WzmhL_e0s6vQkGY-b4ETNto0dCaXbV60BVr2GAH4v5c44Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Jun 22, 2017 at 9:52 AM, Jan de Visser <jan(at)de-visser(dot)net> wrote:
> I am not quite sure what you're trying to achieve, but are you aware that
> pgsql 9.6 introduced the ON CONFLICT clause, which allows you to do the same
> with a different syntax?
>
> https://www.postgresql.org/docs/9.6/static/sql-insert.html

I don't think it's the same thing. I think we could reasonably have
both SQL MERGE and ON CONFLICT. Or at least, I think that that makes
sense. Teradata already has both (their own custom UPSERT syntax, plus
an implementation of SQL MERGE).

Boxuan Zhai's patch didn't try to do anything special about
concurrency. At the time, this was controversial. However, we now
understand that SQL MERGE really isn't obligated to handle that at all
[1]. Besides, we have ON CONFLICT for those use-cases.

[1] https://wiki.postgresql.org/wiki/UPSERT#MERGE_disadvantages
--
Peter Geoghegan

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2017-06-22 17:22:21 Re: Beta 10 parser error for CREATE STATISTICS IF NOT EXISTS
Previous Message Kang Yuzhe 2017-06-22 17:08:14 Re: SQL MERGE patches for PostgreSQL Versions