Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 56C1A1337BDE for ; Mon, 11 Apr 2011 16:46:47 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 73310-03 for ; Mon, 11 Apr 2011 19:46:39 +0000 (UTC) Received: from mx2.hub.org (mx2.hub.org [200.46.204.254]) by mail.postgresql.org (Postfix) with ESMTP id 0BF1F1337999 for ; Mon, 11 Apr 2011 16:46:39 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mbx.knossos.net.nz (mbx.knossos.net.nz [202.160.48.10]) by mx2.hub.org (Postfix) with ESMTP id 0AD533EAE3EF for ; Mon, 11 Apr 2011 04:24:26 -0300 (ADT) Received: from [10.1.1.3] (60-234-150-59.bitstream.orcon.net.nz [60.234.150.59]) (authenticated bits=0) by mbx.knossos.net.nz (8.14.4/8.14.4) with ESMTP id p3B76luG013992 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 11 Apr 2011 19:06:54 +1200 Message-ID: <4DA2A887.3090409@archidevsys.co.nz> Date: Mon, 11 Apr 2011 19:06:47 +1200 From: Gavin Flower Organization: ArchiDevSys User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.15) Gecko/20110307 Fedora/3.1.9-0.39.b3pre.fc14 Thunderbird/3.1.9 MIME-Version: 1.0 To: Tom Lane CC: Gavin Flower , pgsql-bugs@postgresql.org Subject: Re: BUG #5968: DOCUMENTATION: SELECT synopsis omits RETURNING keyword References: <201104072349.p37Nn7GX074930@wwwmaster.postgresql.org> <18884.1302231444@sss.pgh.pa.us> <4D9ED3C1.6030103@archidevsys.co.nz> <4D9ED595.3030108@archidevsys.co.nz> <11485.1302273769@sss.pgh.pa.us> In-Reply-To: <11485.1302273769@sss.pgh.pa.us> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: clamav-milter 0.97 at mbx.knossos.net.nz X-Virus-Status: Clean X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-5 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001 X-Spam-Level: X-Archive-Number: 201104/52 X-Sequence-Number: 29971 On 09/04/11 02:42, Tom Lane wrote: > Gavin Flower writes: >> I found were RETURNING is defined, so I was confused... >> ... >> However, may be it would still be good to mention it on the SELECT page? > It is mentioned --- the subsection on the WITH clause points out that > you typically want to use RETURNING on an INSERT/UPDATE/DELETE in WITH. > > I thought about providing an example, but couldn't come up with one that > was both simple and compelling. There's no strong reason to do WITH > (something RETURNING) SELECT ... --- you might as well just do the work > in a straight "something RETURNING" statement. To do something that > actually requires the more complex syntax, you'd need to join the > RETURNING result to another table or another RETURNING result. > Creating an easily understandable example that involves that is beyond > my powers at this time of the morning. > > regards, tom lane I think it may be useful to explain how I looked for explanations of RETURNING, as I am sure some other people adopt the same approach. I located the page for 'SELECT', then I used the search function of the browser to look for the word 'RETURNING'. Partly because I have poor eyesight, I did not pay as much attention to context, as perhaps I should. Often I use the table of conbtents, and sometimes I also use the index. I hope this is a useful perspective on how documentation is sometimes accessed. I often find the examples very helpful, so I am glad you added an example to the page for 'SELECT'. (I had an appreciative chuckle, when I saw my name in the newsletter!) Regards, Gavin