Re: [HACKERS] MERGE SQL Statement for PG11

Simon Riggs <simon@2ndquadrant.com>

From: Simon Riggs <simon@2ndquadrant.com>
To: Alvaro Herrera <alvherre@alvh.no-ip.org>, Andrew Dunstan <andrew.dunstan@2ndquadrant.com>, Pavan Deolasee <pavan.deolasee@2ndquadrant.com>, Robert Haas <robertmhaas@gmail.com>, Peter Geoghegan <pg@bowt.ie>, Stephen Frost <sfrost@snowman.net>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2018-01-18T17:19:44Z
Lists: pgsql-hackers

Attachments

On 30 December 2017 at 11:01, Simon Riggs <simon@2ndquadrant.com> wrote:

> Attached: MERGE patch is now MOSTLY complete, but still WIP.

New v10a attached, with additional dev work by Pavan and some review
from Andrew

> Patch works sufficiently well to take data from source and use it
> correctly against target, for the DELETE operation and INSERT DEFAULT
> VALUES. Patch also includes PL/pgSQL changes.
>
> Patch has full set of docs and tests, but does not yet pass all tests.

Now passes all tests, including throwing new type of semantic error
discovered during dev.

> Patch uses mechanism as agreed previously with Peter G et al. on this thread.

LATEST SUMMARY
Works
* EXPLAIN
* INSERT actions (thanks Pavan)
* UPDATE actions (thanks Pavan)
* DELETE actions
* DO NOTHING actions
* PL/pgSQL
* Triggers for row and statement
* SQL Standard error requirements

Not yet working
* AND conditions (currently WIP, expected soon)
* No isolation tests yet, so EvalPlanQual untested
* RLS
* Partitioning

Based on this successful progress I imagine I'll be looking to commit
this by the end of the CF, allowing us 2 further months to bugfix.

-- 
Simon Riggs                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Commits

  1. Add support for MERGE SQL command

  2. Add API of sorts for transition table handling in trigger.c

  3. Revert MERGE patch

  4. Fix several bugs related to ON CONFLICT's EXCLUDED pseudo relation.