Re: INOUT parameters in procedures

Поиск
Список
Период
Сортировка
От Merlin Moncure
Тема Re: INOUT parameters in procedures
Дата
Msg-id CAHyXU0wnJz1yATUQxc7rrb-7rJAbkYQyLq+b=KSGYh8F19nFVg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: INOUT parameters in procedures  (Merlin Moncure <mmoncure@gmail.com>)
Список pgsql-hackers
On Tue, Mar 20, 2018 at 4:19 PM, Merlin Moncure <mmoncure@gmail.com> wrote:
> A) you can't assign output variables with into:
> CALL p(1) INTO i;  // gives syntax error
>
> B) you can't assign via assignment
> i := p(1); // gives error, 'use CALL'
>
> C) but you *can* via execute
> EXECUTE 'CALL p(1)' INTO i;  // this works!
>
> ...I'm glad 'C' works, as without that there would be no useful way to
> get values out of procedures called from within other
> procedures/functions as things stand today.  'A' ideally also out to
> work, but I'm not sure  'B' should be expected to work since it's
> really a thin layer around SELECT.   What do you think?

Also (sorry for spam),
A procedure created via:
create procedure p() as $$begin call p(); end; $$ language plpgsql;
...will segfault when called -- there ought to be a stack depth check.

merlin


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

Предыдущее
От: Julian Markwort
Дата:
Сообщение: Re: [HACKERS] [FEATURE PATCH] pg_stat_statements with plans (v02)
Следующее
От: Robert Haas
Дата:
Сообщение: Re: [HACKERS] path toward faster partition pruning