Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 9FFE719964F2 for ; Fri, 16 Mar 2012 18:37:57 -0300 (ADT) Received: from mail.anarazel.de ([217.115.131.40]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1S8eqS-0006cs-Ci for pgsql-hackers@postgresql.org; Fri, 16 Mar 2012 21:37:57 +0000 Received: by mail.anarazel.de (Postfix, from userid 108) id 8D290480004; Fri, 16 Mar 2012 22:37:43 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on mail X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 Received: from anarazel.de (brln-4d0cc7c8.pool.mediaWays.net [77.12.199.200]) (Authenticated sender: andres@anarazel.de) by mail.anarazel.de (Postfix) with ESMTPSA id B2F8D480003; Fri, 16 Mar 2012 22:37:39 +0100 (CET) Received: by anarazel.de (Postfix, from userid 1000) id F0F9F1C00AA; Fri, 16 Mar 2012 22:37:38 +0100 (CET) From: Andres Freund To: pgsql-hackers@postgresql.org Subject: Re: Command Triggers, patch v11 Date: Fri, 16 Mar 2012 22:37:38 +0100 User-Agent: KMail/1.13.7 (Linux/3.3.0-rc3-andres-00278-g4903062; KDE/4.6.5; x86_64; ; ) Cc: Tom Lane , Thom Brown , Dimitri Fontaine References: <201203162207.23896.andres@anarazel.de> <21494.1331933517@sss.pgh.pa.us> In-Reply-To: <21494.1331933517@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201203162237.38813.andres@anarazel.de> X-Pg-Spam-Score: -2.6 (--) X-Archive-Number: 201203/1115 X-Sequence-Number: 204997 On Friday, March 16, 2012 10:31:57 PM Tom Lane wrote: > Andres Freund writes: > > One more thing I disliked quite a bit was the duplication of the EXECUTE > > handling. Do you see a way to deduplicate that? > Yeah, that's what's bugging me, too. I think a chunk of the problem is > that you're insisting on having control come back to CreateTableAs() > to perform the table creation. I'm thinking that if the table creation > were to be moved into the tuple receiver's startup routine, we could > avoid needing to get control back between ExecutorStartup and > ExecutorRun, and then all that would be required would be to call > ExecuteQuery with a different DestReceiver. Hm. I seriously dislike doing that in the receiver. I can't really point out why though. Unsurprisingly I like getting the control back to CreateTableAs... Andres