Re: [HACKERS] MERGE SQL Statement for PG11

Andres Freund <andres@anarazel.de>

From: Andres Freund <andres@anarazel.de>
To: Peter Geoghegan <pg@bowt.ie>
Cc: Simon Riggs <simon@2ndquadrant.com>, Tom Lane <tgl@sss.pgh.pa.us>, Pavan Deolasee <pavan.deolasee@gmail.com>, Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>, Robert Haas <robertmhaas@gmail.com>, Tomas Vondra <tomas.vondra@2ndquadrant.com>, Alvaro Herrera <alvherre@alvh.no-ip.org>, Andrew Dunstan <andrew.dunstan@2ndquadrant.com>, Pavan Deolasee <pavan.deolasee@2ndquadrant.com>, Stephen Frost <sfrost@snowman.net>, PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2018-04-03T03:22:40Z
Lists: pgsql-hackers
Hi,

On 2018-04-02 19:40:12 -0700, Peter Geoghegan wrote:
> > So what happens if there's a concurrent insertion of a potentially
> > matching tuple?
> 
> It's not a special case. In all likelihood, you get a dup violation.
> This is a behavior that I argued for from an early stage.

Right. I think that should be mentioned in the comment...

Greetings,

Andres Freund


Commits

  1. Add support for MERGE SQL command

  2. Avoid repeated name lookups during table and index DDL.

  3. Use an MVCC snapshot, rather than SnapshotNow, for catalog scans.