Re: BUG #5968: DOCUMENTATION: SELECT synopsis omits RETURNING keyword

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Gavin Flower <GavinFlower(at)archidevsys(dot)co(dot)nz>
Cc: Gavin Flower <gavin(dot)flower(at)archidevsys(dot)co(dot)nz>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #5968: DOCUMENTATION: SELECT synopsis omits RETURNING keyword
Date: 2011-04-08 14:42:49
Message-ID: 11485.1302273769@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Gavin Flower <GavinFlower(at)archidevsys(dot)co(dot)nz> 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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Alvaro Herrera 2011-04-08 14:43:48 Re: BUG #5956: quiero crear una base de datos -E LATIN1 en la version 8.4
Previous Message Alvaro Herrera 2011-04-08 14:41:43 Re: Failed assert ((data - start) == data_size) in heaptuple.c