Re: Mention RETURNING ... INTO target

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: s(at)xss(dot)de, Pg Docs <pgsql-docs(at)lists(dot)postgresql(dot)org>
Subject: Re: Mention RETURNING ... INTO target
Date: 2022-06-07 20:47:14
Message-ID: CAKFQuwa6JQ9kBTOnCALcPOSqvAr7_xtT00ox5KD98n-AXn+7pA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

n Tue, Jun 7, 2022 at 1:30 PM PG Doc comments form <noreply(at)postgresql(dot)org>
wrote:

> The following documentation comment has been logged on the website:
>
> Page: https://www.postgresql.org/docs/14/sql-insert.html
> Description:
>
> It looks like INSERT INTO ... RETURNING allows defining a target for the
> returned values like SELECT ... INTO does.
>
> This could be mentioned in the synopsis, or at least in the description of
> "output_expression", maybe even garnished with an example.
>
>
That isn't how it works. RETURNING simply turns INSERT into a result set
producing SQL Command. And SQL doesn't have a concept of "target"
(variables) in the sense you are thinking. pg/pgsql does, allowing result
set data to be placed into variables.

If you look you'll notice a corresponding lack of "INTO" on the SELECT
Command reference page as well, for the same reason.

David J.

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Tom Lane 2022-06-07 21:07:30 Re: Mention RETURNING ... INTO target
Previous Message PG Doc comments form 2022-06-07 18:31:36 Mention RETURNING ... INTO target