Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id B4E4A632C8C for ; Mon, 5 Apr 2010 12:40:37 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 37592-01 for ; Mon, 5 Apr 2010 15:40:27 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail.develix.com (mail.develix.com [69.168.53.29]) by mail.postgresql.org (Postfix) with ESMTP id 4E46A632A0E for ; Mon, 5 Apr 2010 12:40:27 -0300 (ADT) Received: from [192.168.1.199] (c-67-189-90-169.hsd1.or.comcast.net [67.189.90.169]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.develix.com (Postfix) with ESMTP id 7EB28C3E04E for ; Mon, 5 Apr 2010 08:40:25 -0700 (PDT) Subject: Re: INSERT INTO...RETURNING vs SELECT From: Cliff Wells To: pgsql-sql In-Reply-To: <20100405071026.GA5610@tux> References: <1270442932.4749.140.camel@portable-evil> <20100405071026.GA5610@tux> Content-Type: text/plain Date: Mon, 05 Apr 2010 08:40:24 -0700 Message-Id: <1270482024.4749.161.camel@portable-evil> Mime-Version: 1.0 X-Mailer: Evolution 2.26.1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.001 tagged_above=-10 required=5 tests=BAYES_50=0.001 X-Spam-Level: X-Archive-Number: 201004/4 X-Sequence-Number: 33931 On Mon, 2010-04-05 at 09:10 +0200, Andreas Kretschmer wrote: > Cliff Wells wrote: > > > As far as I can see, INSERT INTO...RETURNING is semantically equivalent > > to SELECT...FROM with a side-effect, so it seems this construct should > > work. Can someone shed some light? > > Well, at the moment you can't reuse the RETURNING-values, you have to > wait for 9.1, writeable CTE. Thanks, I just wanted to make sure I wasn't misunderstanding something. Regards, Cliff