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