Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 703D82E037C for ; Sat, 2 Feb 2008 20:38:43 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 64829-09 for ; Sat, 2 Feb 2008 20:38:38 -0400 (AST) Received: from QMTA10.westchester.pa.mail.comcast.net (qmta10.westchester.pa.mail.comcast.net [76.96.62.17]) by postgresql.org (Postfix) with ESMTP id A75FB2E0378 for ; Sat, 2 Feb 2008 20:38:38 -0400 (AST) Received: from OMTA02.westchester.pa.mail.comcast.net ([76.96.62.19]) by QMTA10.westchester.pa.mail.comcast.net with comcast id kd6d1Y0040QuhwU5A0Zb00; Sun, 03 Feb 2008 00:38:24 +0000 Received: from [192.168.0.26] ([24.17.167.182]) by OMTA02.westchester.pa.mail.comcast.net with comcast id koea1Y00E3wT2q03N00000; Sun, 03 Feb 2008 00:38:37 +0000 X-Authority-Analysis: v=1.0 c=1 a=1nwm1U6420sA:10 a=epTmVMiNAAAA:8 a=YsYb-kchK1dfpLrD5JsA:9 a=rdULv9NIuq15_pTC61MA:7 a=xLWRYrQz6RNOqG3uUfKdzlCEl84A:4 a=si9q_4b84H0A:10 a=LY0hPdMaydYA:10 From: Adrian Klaver To: pgsql-sql@postgresql.org Subject: Re: can a insert with a returning clause be subquery ? Date: Sat, 2 Feb 2008 16:40:55 -0800 User-Agent: KMail/1.9.1 Cc: "Jonah H. Harris" , chrisj References: <15248628.post@talk.nabble.com> <36e682920802021612w5b04ca7dk80925b913f4b7261@mail.gmail.com> In-Reply-To: <36e682920802021612w5b04ca7dk80925b913f4b7261@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200802021640.56174.aklaver@comcast.net> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200802/6 X-Sequence-Number: 30097 On Saturday 02 February 2008 4:12 pm, Jonah H. Harris wrote: > On Feb 2, 2008 6:22 PM, chrisj wrote: > > I know I could do this easily with a stored proc, > > but it seems like an obvious use of the returning clause > > > > Am I missing some syntax error > > Nope, you're not missing anything. When I initially wrote this for > Postgres, it didn't support all cases; including the one you're > running into. It's not extremely difficult to extend, but as there > are so few people asking for this functionality, no one has found it > important enough to warrant extension. Perhaps I'll get to it for > 8.4. Would this be a variation of this item from the TODO: * Allow INSERT/UPDATE ... RETURNING inside a SELECT 'FROM' clause http://archives.postgresql.org/pgsql-general/2006-09/msg00803.php http://archives.postgresql.org/pgsql-hackers/2006-10/msg00693.php -- Adrian Klaver aklaver@comcast.net