Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 808E519964F2 for ; Fri, 16 Mar 2012 18:32:15 -0300 (ADT) Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1S8ekw-0006XN-HT for pgsql-hackers@postgresql.org; Fri, 16 Mar 2012 21:32:15 +0000 Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id q2GLVvW9021495; Fri, 16 Mar 2012 17:31:58 -0400 (EDT) To: Andres Freund cc: pgsql-hackers@postgresql.org, Thom Brown , Dimitri Fontaine Subject: Re: Command Triggers, patch v11 In-reply-to: <201203162207.23896.andres@anarazel.de> References: <201203041650.39826.andres@anarazel.de> <20905.1331931287@sss.pgh.pa.us> <201203162207.23896.andres@anarazel.de> Comments: In-reply-to Andres Freund message dated "Fri, 16 Mar 2012 22:07:23 +0100" Date: Fri, 16 Mar 2012 17:31:57 -0400 Message-ID: <21494.1331933517@sss.pgh.pa.us> From: Tom Lane X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201203/1114 X-Sequence-Number: 204996 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. regards, tom lane