Re: CALL and named parameters - Mailing list pgsql-general

From Christoph Moench-Tegeder
Subject Re: CALL and named parameters
Date
Msg-id aJUzP5pwyObo6AeN@elch.exwg.net
Whole thread Raw
In response to Re: CALL and named parameters  (Dominique Devienne <ddevienne@gmail.com>)
Responses Re: CALL and named parameters
List pgsql-general
## Dominique Devienne (ddevienne@gmail.com):

> dd_v185=> call "Epos-DBA".db_grant_connect_to(grantee_role => 'dd_joe');
> ERROR:  procedure Epos-DBA.db_grant_connect_to(grantee_role =>
> unknown) does not exist
> LINE 1: call "Epos-DBA".db_grant_connect_to(grantee_role => 'dd_joe'...

There's the problem: "unknown" type - consider that string there as
"too flexible", it can be coerced into too many types, so the error
says "unknown".
Consider this demonstration:

db=# call proc1(val => 1);
CALL
db=# call proc1(val => '2');
CALL
db=# call proc1(value => 3);
ERROR:  procedure proc1(value => integer) does not exist
LINE 1: call proc1(value => 3);
             ^
HINT:  No procedure matches the given name and argument types. You might need to add explicit type casts.
db=# call proc1(value => '4');
ERROR:  procedure proc1(value => unknown) does not exist
LINE 1: call proc1(value => '4');
             ^
HINT:  No procedure matches the given name and argument types. You might need to add explicit type casts.
db=# call proc1(value => text '5');
ERROR:  procedure proc1(value => text) does not exist
LINE 1: call proc1(value => text '5');
             ^
HINT:  No procedure matches the given name and argument types. You might need to add explicit type casts.

Regards,
Christoph

-- 
Spare Space



pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: Libpq.dll
Next
From: Tom Lane
Date:
Subject: Re: CALL and named parameters