Odd procedure resolution

Поиск
Список
Период
Сортировка
От Ashutosh Bapat
Тема Odd procedure resolution
Дата
Msg-id CAFjFpRcuDTh8MSM+hJOzSeQq_yqxrYQv=y1CRD=8WyfY2S=OzA@mail.gmail.com
обсуждение исходный текст
Ответы Re: Odd procedure resolution  (Ashutosh Bapat <ashutosh.bapat@enterprisedb.com>)
Список pgsql-hackers
Hi,
Consider following scenario

create function foo(a int) returns integer as $$begin return a; end;
$$ language plpgsql;
create procedure foo(a float) as $$begin end; $$ language plpgsql;
call foo(1);
psql:proc_func_resolution.sql:8: ERROR:  foo(integer) is not a procedure
LINE 1: call foo(1);
             ^
HINT:  To call a function, use SELECT.

to me the error message looks confusing. I am using CALL, which means
I am trying to invoke a "procedure" not a "function" and there exists
one which can be invoked. If I drop function foo() and try call again,
it succeeds.

drop function foo(a int);
DROP FUNCTION
call foo(1);
CALL

Functions and Procedures are two different objects and we enforce
different methods to invoke those, SELECT and CALL resp. So, we should
be able to filter out one or the other and try to find best candidate
of a given kind.

-- 
Best Wishes,
Ashutosh Bapat
EnterpriseDB Corporation
The Postgres Database Company


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

Предыдущее
От: Pavan Deolasee
Дата:
Сообщение: Re: Faster inserts with mostly-monotonically increasing values
Следующее
От: Etsuro Fujita
Дата:
Сообщение: Re: ON CONFLICT DO UPDATE for partitioned tables