Re: CALL and named parameters

2025-08-08 Thread Dominique Devienne
On Fri, Aug 8, 2025 at 1:33 AM Tom Lane wrote: > Christoph Moench-Tegeder writes: > > ## Dominique Devienne (ddevie...@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 n

Re: CALL and named parameters

2025-08-07 Thread Tom Lane
Christoph Moench-Tegeder writes: > ## Dominique Devienne (ddevie...@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(gr

Re: CALL and named parameters

2025-08-07 Thread Christoph Moench-Tegeder
## Dominique Devienne (ddevie...@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

Re: CALL and named parameters

2025-08-07 Thread Tom Lane
Dominique Devienne writes: > But still, arg names are not part of the signature. > So they should be checked after the fact. No, that's not how it works. David's comment about signature reflects the fact that the primary key of pg_proc is name + schema + input argument types. Arg names are inde

Re: CALL and named parameters

2025-08-07 Thread Dominique Devienne
On Thu, Aug 7, 2025 at 4:36 PM Tom Lane wrote: > Dominique Devienne writes: > > I was expecting an error telling me the procedure exists, but the > > argument name used in the call didn't. Then it's obvious to me what > > mistake I made. If argument names don't participate in the function's > > s

Re: CALL and named parameters

2025-08-07 Thread Tom Lane
Dominique Devienne writes: > I was expecting an error telling me the procedure exists, but the > argument name used in the call didn't. Then it's obvious to me what > mistake I made. If argument names don't participate in the function's > signature, why should they participate in the lookup? Do th

Re: CALL and named parameters

2025-08-07 Thread Dominique Devienne
On Thu, Aug 7, 2025 at 4:21 PM Tom Lane wrote: > The message presumably was like > > ERROR: procedure ... does not exist > HINT: No procedure matches the given name and argument types. You might need > to add explicit type casts. Hi Tom. Indeed it was. I shared my psql session showing that.

Re: CALL and named parameters

2025-08-07 Thread Tom Lane
"David G. Johnston" writes: > On Thursday, August 7, 2025, Dominique Devienne wrote: >> What's not nice is in the way it failed IMHO. I guess I persist it's >> not a user friendly message :) > Then write the error message you would have liked to see. The message presumably was like ERROR: pro

Re: CALL and named parameters

2025-08-07 Thread Dominique Devienne
On Thu, Aug 7, 2025 at 3:30 PM David G. Johnston wrote: > On Thursday, August 7, 2025, Dominique Devienne wrote: >> Can you overload a function solely by changing an argument name? > No, the signature is only the name and input argument types. Thanks for confirming. >> So the function did exist

Re: CALL and named parameters

2025-08-07 Thread Pavel Stehule
Hi čt 7. 8. 2025 v 15:30 odesílatel David G. Johnston < david.g.johns...@gmail.com> napsal: > On Thursday, August 7, 2025, Dominique Devienne > wrote: >> >> >> What's not nice is in the way it failed IMHO. I guess I persist it's >> not a user friendly message :) > > > Then write the error messag

Re: CALL and named parameters

2025-08-07 Thread David G. Johnston
On Thursday, August 7, 2025, Dominique Devienne wrote: > > > What's not nice is in the way it failed IMHO. I guess I persist it's > not a user friendly message :) Then write the error message you would have liked to see. > > Can you overload a function solely by changing an argument name? No

Re: CALL and named parameters

2025-08-07 Thread Dominique Devienne
On Wed, Aug 6, 2025 at 8:09 PM Pavel Stehule wrote: > Maybe there is another issue? Indeed. Thanks Pavel, Andrian, Christoph, for demonstrating I was wrong. I misinterpreted the signals I got, and accepted the AI's interpretation on success (after a long day) when the inderlying isse was elsewher

Re: CALL and named parameters

2025-08-06 Thread Christoph Moench-Tegeder
## Dominique Devienne (ddevie...@gmail.com): > Turns out, thanks to ChatGPT for clueing me in, CALL does NOT support > named parameters. Turns out, ChatGPT is once again very wrong. As per https://www.postgresql.org/docs/14/sql-call.html , "Arguments can include parameter names, using the syntax

Re: CALL and named parameters

2025-08-06 Thread Adrian Klaver
On 8/6/25 10:48, Dominique Devienne wrote: (sorry, this is a rant...). Was getting an error calling a procedure ERROR: procedure ... does not exist HINT: No procedure matches the given name and argument types. You might need to add explicit type casts. I verify USAGE on the SCHEMA of the pro

Re: CALL and named parameters

2025-08-06 Thread Pavel Stehule
Hi st 6. 8. 2025 v 19:49 odesílatel Dominique Devienne napsal: > (sorry, this is a rant...). > > Was getting an error calling a procedure > > ERROR: procedure ... does not exist > HINT: No procedure matches the given name and argument types. You > might need to add explicit type casts. > > I v

CALL and named parameters

2025-08-06 Thread Dominique Devienne
(sorry, this is a rant...). Was getting an error calling a procedure ERROR: procedure ... does not exist HINT: No procedure matches the given name and argument types. You might need to add explicit type casts. I verify USAGE on the SCHEMA of the proc. OK. I verify EXECUTE on the FUNCTION. OK.