Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uk1Qa-00Eljq-BT for pgsql-general@arkaria.postgresql.org; Thu, 07 Aug 2025 14:17:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1uk1QZ-004u7E-1b for pgsql-general@arkaria.postgresql.org; Thu, 07 Aug 2025 14:17:07 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uk1QY-004u74-H6 for pgsql-general@lists.postgresql.org; Thu, 07 Aug 2025 14:17:06 +0000 Received: from mail-yw1-x112f.google.com ([2607:f8b0:4864:20::112f]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uk1QV-001ER4-0m for pgsql-general@lists.postgresql.org; Thu, 07 Aug 2025 14:17:05 +0000 Received: by mail-yw1-x112f.google.com with SMTP id 00721157ae682-71a38e35674so6197067b3.3 for ; Thu, 07 Aug 2025 07:17:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754576223; x=1755181023; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=moctEfJFHh/pJdaNBWBTcW9I5xavy5WHsD2x2pOmwQE=; b=cRH9Ue6hri67gbQeV+KQ8ENSzMeaFYaHENcG21AK3z83uq6NhyrgYLorx8A1Mdl8kO SKQKNydS/bjkYgTe6z0jrK4oJNu/XYLVWiG9DQbXvXy90dNhsd6tlHGzLcNk/hneEfXi +n9u1lnzUYlViKKY89ntcuxFvVt1lvyMOg3Vla6RfKS9QklGwrSsO/b8Z9IYDPrM2rpf rRweJE88wo2fR2peaQtuES8tB26MaQrB5qa4a69hFHINY1+jkcJ3xEqaPqMNPazMM32B Sf2QDilLOLJ6bKsseOHjwlVqI1GkMoG0+UNXSyhrBCfhiZKE4Ub16ddxRTlep4hcGwsf fc7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754576223; x=1755181023; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=moctEfJFHh/pJdaNBWBTcW9I5xavy5WHsD2x2pOmwQE=; b=weaAtydfWmGMQDVqXltUnGSuDUL6AfbfIdYpac2EA0qheHrkDtEvJ9sh5HMbEtqZac /vz345YtxxToIs3Z2e4iWyT/4+Qi9TkkDQPd1hqG1CNslQ84O+OsPbGwz6Q7m4q3UbGB X2IytxrZnkQwUO4N1tNn+Zufqt+Kjk+7V/7iS6JtwWf8hmnkCGiJtyxUR0LC0qVgUbIV pRb3F2kQ2pysWZmPQbJ2nnv1560P2yO+bEDszsDGVlh8rTdn/uUABpfy6LLSq9smwKxZ YvMaYYlYffURFcZLdsdgDtkusssOJ1YizhqVmgp3zHcCnQMHQxM8h7/HfqVEyq5iig6N 5Zsg== X-Forwarded-Encrypted: i=1; AJvYcCX+rOPDPuhiZ4AukJEE0PlOTWbiF830MzTXIYZc64FIkeajd2E37AOpkdlx8plxoVoaaBQWS/VdkvaXueYr@lists.postgresql.org X-Gm-Message-State: AOJu0YwINNw+MeYuQU7zMnOPLtNXAPKvvderLcknEAmPrtwNXDC9RwKA lMXbXpU0lHTSMAsOwJHCkIjf+74Yj4u7UDONdc00DRbLSYzVb09ToCadCpsZRRyGMU3XZvwjgVj 4xhTMKDTzGSViSyMUxxo0129aT2k2RxU= X-Gm-Gg: ASbGnctRHBbj9fnrpBfnObT7ZfRd10BxSabQNSFrjwwzkt6dakbMBE7VKHY+qgGu1kN d4Kfvhspm+2xcG380q8GOqV5F3XcVoe0XvU+0m+3+iFiF8vajvdyDDk0KJMYA0gjv9uOuo+tND0 ONNbH1plLUA0b6Hlq3ssSykpXQCyzEx0tXELDvPnPfKNE4JeCr3JtBpXgd+u77CABEVtFs2Ixcn qhQWTyb6xv0J3UwgmGSMan6c90U3HYNZOOwwGPa X-Google-Smtp-Source: AGHT+IHAm6qVoR+4aRFsvzjF69/5dxW7TQZg1hz0/dDLz++IRws5F2vXCbF8TY9LuX8sJee4CL2VfRWNDC0uWbZ1bAw= X-Received: by 2002:a05:690c:6712:b0:71a:1fab:e156 with SMTP id 00721157ae682-71bcc722a84mr77472867b3.13.1754576223076; Thu, 07 Aug 2025 07:17:03 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Pavel Stehule Date: Thu, 7 Aug 2025 16:16:25 +0200 X-Gm-Features: Ac12FXy2NwcQQzL_yOPST-8L576P6akEAbpGevXK3f0X5I5cK7PLXrIAo-gJy4U Message-ID: Subject: Re: CALL and named parameters To: "David G. Johnston" Cc: Dominique Devienne , "pgsql-general@lists.postgresql.org" Content-Type: multipart/alternative; boundary="00000000000082032b063bc71ce1" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --00000000000082032b063bc71ce1 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi =C4=8Dt 7. 8. 2025 v 15:30 odes=C3=ADlatel David G. Johnston < david.g.johnston@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 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 =E2=80=9Cjust=E2=80=9D an argument name when you are using name= d argument syntax? > > David J. > > (2025-08-07 15:58:24) postgres=3D# select fx(b=3D>10); ERROR: function fx(b =3D> integer) does not exist LINE 1: select fx(b=3D>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 --00000000000082032b063bc71ce1 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi

=C4=8Dt 7. 8. 2025 v=C2=A015:= 30 odes=C3=ADlatel David G. Johnston <david.g.johnston@gmail.com> napsal:
On Thursday, August 7, 2025, Dominiq= ue Devienne <dd= evienne@gmail.com> 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 t= he error message you would have liked to see.
=C2=A0

Can you overload a function solely by changing an argument name?

No, the signature is only the name and input argument= types.
=C2=A0
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 =E2=80=9Cjust=E2=80=9D an argument = name when you are using named argument syntax?

Dav= id J.


(2025-08-07 15:5= 8:24) postgres=3D# select fx(b=3D>10);
ERROR: =C2=A0function fx(b =3D= > integer) does not exist
LINE 1: select fx(b=3D>10);
=C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0^
HINT: =C2=A0No functio= n matches the given name and argument types. You might need to add explicit= type casts.

The error message and hint is similla= ry unfriendly like for a case with unnamed parameters. I am afraid that imp= lementing 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 signatur= e, 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.=C2=A0

Regards

Pavel



--00000000000082032b063bc71ce1--