Re: MERGE Specification - Mailing list pgsql-hackers

From Tom Lane
Subject Re: MERGE Specification
Date
Msg-id 8766.1208824097@sss.pgh.pa.us
Whole thread Raw
In response to Re: MERGE Specification  (Simon Riggs <simon@2ndquadrant.com>)
Responses Re: MERGE Specification  (Simon Riggs <simon@2ndquadrant.com>)
Re: MERGE Specification  (Simon Riggs <simon@2ndquadrant.com>)
List pgsql-hackers
Simon Riggs <simon@2ndquadrant.com> writes:
> On Mon, 2008-04-21 at 16:38 -0400, A.M. wrote:
>> "MERGE will not invoke Rules." Does this imply that MERGE cannot be  
>> used on views or that the resulting INSERTs or UPDATEs do not work on  
>> views?

> Yes, that's right. Just like COPY.

I find this to be pretty ugly.  COPY is a special case because
(a) it is a utility statement not a plannable one, and (b) its only
reason to exist is to transfer data as fast as possible, so bypassing
rules isn't an unreasonable restriction.  MERGE has neither of those
properties, and thus arguing that it can or should be like COPY is an
entirely unconvincing proposition.  (In fact, I don't even want to think
about what kind of crock you're going to need in order to get it through
the planner without also going through the rewriter.)

Please think a bit harder.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Problem with server/utils/snapmgr.h
Next
From: Simon Riggs
Date:
Subject: Re: MERGE Specification