Re: Mention RETURNING ... INTO target

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Mention RETURNING ... INTO target
Дата
Msg-id 1334778.1654636050@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Mention RETURNING ... INTO target  ("David G. Johnston" <david.g.johnston@gmail.com>)
Ответы Re[2]: Mention RETURNING ... INTO target  ("Stefan Schmiedl" <s@xss.de>)
Список pgsql-docs
"David G. Johnston" <david.g.johnston@gmail.com> writes:
> On Tue, Jun 7, 2022 at 1:30 PM PG Doc comments form <noreply@postgresql.org>
> wrote:
>> It looks like INSERT INTO ... RETURNING allows defining a target for the
>> returned values like SELECT ... INTO does.

> 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.

Right.  And in fact this *is* documented in the context of pl/pgsql:

https://www.postgresql.org/docs/current/plpgsql-statements.html#PLPGSQL-STATEMENTS-SQL-ONEROW

            regards, tom lane



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

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: Mention RETURNING ... INTO target
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: correction