Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 91BB5C7DB11 for ; Mon, 19 Mar 2012 13:45:29 -0300 (ADT) Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1S9fi4-0003Av-Hd for pgsql-hackers@postgresql.org; Mon, 19 Mar 2012 16:45:28 +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 q2JGjB1Y003116; Mon, 19 Mar 2012 12:45:11 -0400 (EDT) To: Robert Haas cc: Andres Freund , pgsql-hackers@postgresql.org, Thom Brown , Dimitri Fontaine Subject: Re: Command Triggers, patch v11 In-reply-to: References: <9503.1332006327@sss.pgh.pa.us> <24814.1332021870@sss.pgh.pa.us> <201203172326.53461.andres@anarazel.de> <18353.1332095370@sss.pgh.pa.us> Comments: In-reply-to Robert Haas message dated "Mon, 19 Mar 2012 12:35:06 -0400" Date: Mon, 19 Mar 2012 12:45:11 -0400 Message-ID: <3115.1332175511@sss.pgh.pa.us> From: Tom Lane X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201203/1224 X-Sequence-Number: 205106 Robert Haas writes: > On Sun, Mar 18, 2012 at 2:29 PM, Tom Lane wrote: >> 1. ExecuteQuery still has to know that's a CREATE TABLE AS operation so >> that it can enforce that the prepared query is a SELECT. (BTW, maybe >> this should be weakened to "something that returns tuples", in view of >> RETURNING?) > +1 for "something that returns with tuples". CREATE TABLE ... AS > DELETE FROM ... WHERE ... RETURNING ... seems like a cool thing to > support. For the moment I've backed off that idea. The main definitional question we'd have to resolve is whether we want to allow WITH NO DATA, and if so what does that mean (should the DELETE execute, or not?). I am also not certain that the RETURNING code paths would cope with a WITH OIDS specification, and there are some other things that would need fixed. It might be cool to do it sometime, but it's not going to happen in this patch. regards, tom lane