pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Gavin Flower <GavinFlower@archidevsys.co.nz>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Gavin Flower <gavin.flower@archidevsys.co.nz>
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #5968: DOCUMENTATION: SELECT synopsis omits RETURNING keyword
Date: Fri, 08 Apr 2011 21:29:57 +1200
Message-ID: <4D9ED595.3030108@archidevsys.co.nz> (raw)
In-Reply-To: <4D9ED3C1.6030103@archidevsys.co.nz>
References: <201104072349.p37Nn7GX074930@wwwmaster.postgresql.org>
	<18884.1302231444@sss.pgh.pa.us>
	<4D9ED3C1.6030103@archidevsys.co.nz>

On 08/04/11 21:22, Gavin Flower wrote:
> On 08/04/11 14:57, Tom Lane wrote:
>> "Gavin Flower"<gavin.flower@archidevsys.co.nz>  writes:
>>> I think the documentation of SELECT should include the keyword 'RETURNING'
>>> in its synopsis.
>> Huh?  There's no SELECT RETURNING.
>>
>> 			regards, tom lane
> The 'WITH' clause is described in the synopsis for 'SELECT' - and the 
> 'WITH' clause uses the keyword 'RETURNING'.
>
> and/with_query/  is:
>
>      /with_query_name/  [ (/column_name/  [, ...] ) ] AS (/select/  |/insert/  |/update/  |/delete/  )
>
> So as the 'WITH' clause is defined in the synopsis, I would expect 
> that the synopsis for 'SELECT' should also mention the 'RETURNING' 
> keyword - but it does not.
>
> There is an example in:
> '7.8. WITH Queries (Common Table Expressions)'
> WITH t AS (
>      UPDATE products SET price = price * 1.05
>      RETURNING *
> )
> SELECT * FROM t;
>
> Regards,
> Gavin 

I found were RETURNING is defined, so I was confused...


    Synopsis

UPDATE [ ONLY ]/table/  [ [ AS ]/alias/  ]
     SET {/column/  = {/expression/  | DEFAULT } |
           (/column/  [, ...] ) = ( {/expression/  | DEFAULT } [, ...] ) } [, ...]
     [ FROM/fromlist/  ]
     [ WHERE/condition/  | WHERE CURRENT OF/cursor_name/  ]
     [ RETURNING * |/output_expression/  [ [ AS ]/output_name/  ] [, ...] ]


However, may be it would still be good to mention it on the SELECT page?


Cheers,
Gavin

(Who while feeling a little foolish, still thinks he has a valid point!)

view thread (6+ messages)  latest in thread

Message-ID: <4D9ED595.3030108@archidevsys.co.nz>
Permalink:  ../4D9ED595.3030108@archidevsys.co.nz/
Also on:    postgresql.org/message-id/4D9ED595.3030108@archidevsys.co.nz

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: GavinFlower@archidevsys.co.nz, tgl@sss.pgh.pa.us, gavin.flower@archidevsys.co.nz
  Subject: Re: BUG #5968: DOCUMENTATION: SELECT synopsis omits RETURNING keyword
  In-Reply-To: <4D9ED595.3030108@archidevsys.co.nz>
  References: <201104072349.p37Nn7GX074930@wwwmaster.postgresql.org> <18884.1302231444@sss.pgh.pa.us> <4D9ED3C1.6030103@archidevsys.co.nz> <4D9ED595.3030108@archidevsys.co.nz>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox