Re: Add support for printing/reading MergeAction nodes

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Add support for printing/reading MergeAction nodes
Дата
Msg-id 20538.1522861711@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Add support for printing/reading MergeAction nodes  (Simon Riggs <simon@2ndquadrant.com>)
Ответы Re: Add support for printing/reading MergeAction nodes  (Simon Riggs <simon@2ndquadrant.com>)
Список 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 по дате отправления:

Предыдущее
От: Simon Riggs
Дата:
Сообщение: Re: Add support for printing/reading MergeAction nodes
Следующее
От: Andres Freund
Дата:
Сообщение: Re: pgsql: New files for MERGE