Re: Add support for printing/reading MergeAction nodes - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Add support for printing/reading MergeAction nodes
Date
Msg-id 20538.1522861711@sss.pgh.pa.us
Whole thread Raw
In response to Re: Add support for printing/reading MergeAction nodes  (Simon Riggs <simon@2ndquadrant.com>)
Responses Re: Add support for printing/reading MergeAction nodes
List pgsql-hackers
Simon Riggs <simon@2ndquadrant.com> writes:
> On 4 April 2018 at 17:19, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> BTW, poking around in the grammar, I notice that MergeStmt did not
>> get added to RuleActionStmt.  That seems like a rather serious
>> omission.

> MERGE isn't a privilege, a trigger action or a policy action. Why
> would it be in RuleActionStmt?

Because it seems likely that somebody would want to write a rule along
the lines of "ON UPDATE TO mytable DO INSTEAD MERGE ...".

Looking a little further ahead, one can easily envision somebody
wanting to do "ON MERGE TO mytable DO INSTEAD something".  I'd be
prepared to give a pass on that for the present, partly because
it's not very clear what stuff from the original MERGE needs to be
available to the rule.  But the other case seems pretty fundamental.
MERGE is not supposed to be a utility command IMO, it's supposed to
be DML, and that means it needs to work anywhere that you could
write e.g. UPDATE.

            regards, tom lane


pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: Add support for printing/reading MergeAction nodes
Next
From: Andres Freund
Date:
Subject: Re: pgsql: New files for MERGE