public inbox for [email protected]
help / color / mirror / Atom feedFrom: David G. Johnston <[email protected]>
To: [email protected]
To: Pg Docs <[email protected]>
Subject: Re: Mention RETURNING ... INTO target
Date: Tue, 7 Jun 2022 13:47:14 -0700
Message-ID: <CAKFQuwa6JQ9kBTOnCALcPOSqvAr7_xtT00ox5KD98n-AXn+7pA@mail.gmail.com> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
n Tue, Jun 7, 2022 at 1:30 PM PG Doc comments form <[email protected]>
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.
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 using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected]
Subject: Re: Mention RETURNING ... INTO target
In-Reply-To: <CAKFQuwa6JQ9kBTOnCALcPOSqvAr7_xtT00ox5KD98n-AXn+7pA@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox