public inbox for [email protected]  
help / color / mirror / Atom feed
From: Pavel Stehule <[email protected]>
To: David G. Johnston <[email protected]>
Cc: Dominique Devienne <[email protected]>
Cc: [email protected] <[email protected]>
Subject: Re: CALL and named parameters
Date: Thu, 7 Aug 2025 16:16:25 +0200
Message-ID: <CAFj8pRDzBnmztqJY9Zf-DKfK5WYwYzs94R83=w3FjqD1MDvLXQ@mail.gmail.com> (raw)
In-Reply-To: <CAKFQuwaGO-pmBVc2Vk9vwmbkhNpxHeZM77=oCtG+Duoc-G58cg@mail.gmail.com>
References: <CAFCRh-_iLoUtMAtyunw_-O6sgpWo04sOmB38MUVNpuQVSkL_0Q@mail.gmail.com>
	<CAFj8pRCyW4E5OnZDGvk_YnPqaS_PfK-VKJOKGndC-gtAtDOtBw@mail.gmail.com>
	<CAFCRh-9XkFS==OwSB6jgY84L5d4PkV_Y9MxLgk=NVx0Z8W3o_A@mail.gmail.com>
	<CAKFQuwaGO-pmBVc2Vk9vwmbkhNpxHeZM77=oCtG+Duoc-G58cg@mail.gmail.com>

Hi

čt 7. 8. 2025 v 15:30 odesílatel David G. Johnston <
[email protected]> napsal:

> On Thursday, August 7, 2025, Dominique Devienne <[email protected]>
> 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, the signature is only the name and input argument types.
>
>
>> If not, as I suspect, then function lookup doesn't strictly depend on
>> argument names (like in C++).
>> So the function did exist, with the correct "signature" (ignoring
>> argument names).
>> And I was "just" using the wrong arg-name. That tripped me up.
>
>
> How is it “just” an argument name when you are using named argument syntax?
>
> David J.
>
>
(2025-08-07 15:58:24) postgres=# select fx(b=>10);
ERROR:  function fx(b => integer) does not exist
LINE 1: select fx(b=>10);
               ^
HINT:  No function matches the given name and argument types. You might
need to add explicit type casts.

The error message and hint is simillary unfriendly like for a case with
unnamed parameters. I am afraid that implementing a more friendly error
message can slow down the query execution :-/. Now we raise errors when we
know, so we didn't find a good signature, but we don't know what is wrong,
so it is difficult to raise errors in the sense that the name of the
argument is wrong.

Regards

Pavel


reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected]
  Subject: Re: CALL and named parameters
  In-Reply-To: <CAFj8pRDzBnmztqJY9Zf-DKfK5WYwYzs94R83=w3FjqD1MDvLXQ@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox