Odd procedure resolution - Mailing list pgsql-hackers

From Ashutosh Bapat
Subject Odd procedure resolution
Date
Msg-id CAFjFpRcuDTh8MSM+hJOzSeQq_yqxrYQv=y1CRD=8WyfY2S=OzA@mail.gmail.com
Whole thread Raw
Responses Re: Odd procedure resolution  (Ashutosh Bapat <ashutosh.bapat@enterprisedb.com>)
List 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 by date:

Previous
From: Pavan Deolasee
Date:
Subject: Re: Faster inserts with mostly-monotonically increasing values
Next
From: Etsuro Fujita
Date:
Subject: Re: ON CONFLICT DO UPDATE for partitioned tables