select (fn()).* executes function multiple times

Поиск
Список
Период
Сортировка
От Andrey
Тема select (fn()).* executes function multiple times
Дата
Msg-id CAOYf6edujEOGB-9fGG_V9PGQ5O9yoyWmTnE9RyBYTGw+Dq3SpA@mail.gmail.com
обсуждение исходный текст
Ответы Re: select (fn()).* executes function multiple times  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: select (fn()).* executes function multiple times  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-bugs
PostgreSQL 10.5, 11.1:

create table fn_ret_test_storage (f1 int default 1, f2 int default 2, f3 int default 3);

create or replace function fn_ret_test(out f1 int, out f2 int, out f3 int)
returns record
language plpgsql
as
$$
begin
insert into fn_ret_test_storage default values
returning * into f1, f2, f3;
end
$$;

do
$$
declare
_count int;
begin
select count(*) into _count from fn_ret_test_storage;
perform (fn_ret_test()).*;
select count(*) - _count into _count from fn_ret_test_storage;
raise notice '----------------- % rows inserted -----------------', _count;
end
$$;

-- output: NOTICE:  ----------------- 3 rows inserted -----------------

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

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: ALTER INDEX ... ALTER COLUMN not present in dump
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: select (fn()).* executes function multiple times