Re: Mention RETURNING ... INTO target

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: Mention RETURNING ... INTO target
Дата
Msg-id CAKFQuwa6JQ9kBTOnCALcPOSqvAr7_xtT00ox5KD98n-AXn+7pA@mail.gmail.com
обсуждение исходный текст
Ответ на Mention RETURNING ... INTO target  (PG Doc comments form <noreply@postgresql.org>)
Ответы Re: Mention RETURNING ... INTO target  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-docs
n Tue, Jun 7, 2022 at 1:30 PM PG Doc comments form <noreply@postgresql.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.

В списке pgsql-docs по дате отправления:

Предыдущее
От: PG Doc comments form
Дата:
Сообщение: Mention RETURNING ... INTO target
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Mention RETURNING ... INTO target