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 1ujzzZ-00EW8y-A4 for pgsql-general@arkaria.postgresql.org; Thu, 07 Aug 2025 12:45:09 +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 1ujzzX-004NTH-Uk for pgsql-general@arkaria.postgresql.org; Thu, 07 Aug 2025 12:45:07 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1ujzzX-004NT2-Jl for pgsql-general@lists.postgresql.org; Thu, 07 Aug 2025 12:45:07 +0000 Received: from mail-oi1-x22c.google.com ([2607:f8b0:4864:20::22c]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1ujzzV-001GCA-0g for pgsql-general@lists.postgresql.org; Thu, 07 Aug 2025 12:45:07 +0000 Received: by mail-oi1-x22c.google.com with SMTP id 5614622812f47-433fa926cb9so666955b6e.2 for ; Thu, 07 Aug 2025 05:45:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754570703; x=1755175503; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=ImpI1Y0ucXOIdvjoKI3bQK1+9SOsJMvPngYmVFizBUM=; b=G4SZ15iFt3Qtd6yIvL5t/NTePn5DLSyH8m1RM7c4sQ7Q826+6wlMWaaxfDCyX/Ztv+ TSgtCeRyyFZhlT/ijmUwZWif0Q5wZ1XXk+zEpiQpRbxn8XgAh+pBpXh/zPAixbLSF0TO 37rRvE/7A6pf6p6FePzHDosoyUAPZgRQmnU6DX0d+a41lL+K2Ma+GCzA5OI13jUwfn2X zQMipyrZUH8PgOgcD6KiEhg+YRGIGAnm1xJRgInC1U+g2WbkoHdf4j+RqJoSnUUTFeKP AHUY9cRY9PhG9v4fR4JE+OCgeh+k6N1LN7uoJV95MgS82oZwcCQR3dts0kMjp4EpMJRM 6hew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754570703; x=1755175503; h=content-transfer-encoding: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=ImpI1Y0ucXOIdvjoKI3bQK1+9SOsJMvPngYmVFizBUM=; b=CoBddhHYdTjiuRGwCl76z90Hy4pLMJf6ELIz6LJiEoye+TpN8+pjMmKZ1htzS6icRu wZH0RYMDTryyvLdT4xSUMj6r6735AqRAvU0U/2/LVYK/+jQsyI+xXPCX+XI338whJ/NW 7NzoOzRJxems6mqCYGR+O0JC1zoR3TXtlZeuHO2otYiW9RAfupE3oKOY4Mv/uEb/dyo6 DG2nn1RqMjCmleRkBDp9fMC/P6Cr0smMCZqEWv6WKUf9siAHqaZs/QpRRrpjtqDGH5vq Am/c6IRejVMRJ+0NjLZeZOOwK12OrM72vtufCvG49JUWz7orLD/4n7JaXrUFvi+/2zeW 29PQ== X-Gm-Message-State: AOJu0Ywt1K8c3dGWcsAQc8NdsTyN4HAF6e0ksbRbfolWFT1lrdl4eDUE GLBYr7u3Amhw6jAJt0mr/O4VtANM2o1gzUj9Bb/Nd+HM0fi5Drms001WwR7O/hJfEgENm4nCw1Q wTzB+P+V/2NdJGzgLH9BifleJa5rNIibY6srz X-Gm-Gg: ASbGnculXbuaLDk03KQ4ZlB1lQSB02/8hGPQatYMLa9hRIFKq0aATImHo+y/q0iR0rE YTOr2o4Leg99v+sdssUZwRyS30wgRGb/TuMru7YOpWOj7HKG9gUaQo5ywv5gDejjpvc7koYKcrM tPitKwWSOaHk+2shkUTWaWTu5wQ5T/S2HdGyQvpaqBrwjTJsrMSa1W3DZyaRzcCIBb4knP4rGxi tk4ocszYA== X-Google-Smtp-Source: AGHT+IE8wj89tVo/AizPktQzV7hrONfQs2ziSsxWRXSWjZCA2QfISPhoIKc5i6DxKnhG23qQjqKIAN8FDM+9GApaL9o= X-Received: by 2002:a05:6808:f09:b0:434:601:1a79 with SMTP id 5614622812f47-4357a15ca1fmr3796939b6e.27.1754570703094; Thu, 07 Aug 2025 05:45:03 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Dominique Devienne Date: Thu, 7 Aug 2025 14:44:51 +0200 X-Gm-Features: Ac12FXy6ymUK5Stps7XawPgYv1r4YsPyAr4v1zLLE98NyWeCyZe49obElug0bA4 Message-ID: Subject: Re: CALL and named parameters To: Pavel Stehule Cc: pgsql-general@lists.postgresql.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, Aug 6, 2025 at 8:09=E2=80=AFPM 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 elsewhere. My mistake was in > I verify the names of the parameters, in my CALL with named arguments. OK= . I verified against the embedded PL/pgSQL in my code, not what was in the DB= . I had renamed an argument in the code, but the schema was instantiated using the earlier code. And because I was using the named-argument syntax, but a wrong arg-name, it fails. What's not nice is in the way it failed IMHO. I guess I persist it's not a user friendly message :) Can you overload a function solely by changing an argument name? 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. The AI's suggestion, to go positional, while based on crap reasoning, did help me, in a way :). So mea culpa. Apologies for the misguided rant (and smaller re-rant above := )). PS: below's my psql session that led me to the wrong conclusion. dd_v185=3D> call "Epos-DBA".db_grant_connect_to(grantee_role =3D> 'dd_joe')= ; ERROR: procedure Epos-DBA.db_grant_connect_to(grantee_role =3D> unknown) does not exist LINE 1: call "Epos-DBA".db_grant_connect_to(grantee_role =3D> 'dd_joe'... ^ HINT: No procedure matches the given name and argument types. You might need to add explicit type casts. dd_v185=3D> call "Epos-DBA".db_grant_connect_to(grantee_role =3D> 'dd_joe':= :name); ERROR: procedure Epos-DBA.db_grant_connect_to(grantee_role =3D> name) does not exist LINE 1: call "Epos-DBA".db_grant_connect_to(grantee_role =3D> 'dd_joe'... ^ HINT: No procedure matches the given name and argument types. You might need to add explicit type casts. dd_v185=3D> \df "Epos-DBA".db_grant_connect_to List of functions Schema | Name | Result data type | Argument data types | = Type ----------+---------------------+------------------+---------------------+-= ----- Epos-DBA | db_grant_connect_to | | IN login_role name | = proc (1 row) dd_v185=3D> select has_schema_privilege('Epos-DBA', 'usage'); has_schema_privilege ---------------------- t (1 row) dd_v185=3D> select has_function_privilege('"Epos-DBA".db_grant_connect_to(name)', 'execute'); has_function_privilege ------------------------ t (1 row) dd_v185=3D> call "Epos-DBA".db_grant_connect_to('dd_joe'); CALL