Re: INOUT parameters in procedures
От | Merlin Moncure |
---|---|
Тема | Re: INOUT parameters in procedures |
Дата | |
Msg-id | CAHyXU0wMz043mTbg-3h3HEWzPxDd_xgZ8H06XDbhh3rHXhtN4w@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: INOUT parameters in procedures (Pavel Stehule <pavel.stehule@gmail.com>) |
Ответы |
Re: INOUT parameters in procedures
|
Список | pgsql-hackers |
On Tue, Mar 20, 2018 at 10:09 AM, Pavel Stehule <pavel.stehule@gmail.com> wrote: > 2018-03-20 15:18 GMT+01:00 Merlin Moncure <mmoncure@gmail.com>: >> >> postgres=# create or replace procedure p(a inout int default 7) as $$ >> >> begin return; end; $$ language plpgsql; >> >> CREATE PROCEDURE >> >> Time: 1.182 ms >> >> postgres=# call p(); >> >> a >> >> ─── >> >> 0 >> >> (1 row) >> > >> > >> > I wrote patch >> >> Confirmed this fixes the issue. > > Thanks for info You're welcome. Working with this feature some more, I noticed that: 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? merlin
В списке pgsql-hackers по дате отправления: