public inbox for [email protected]  
help / color / mirror / Atom feed
From: Pavel Stehule <[email protected]>
To: Dominique Devienne <[email protected]>
Cc: [email protected]
Subject: Re: CALL and named parameters
Date: Wed, 6 Aug 2025 20:08:36 +0200
Message-ID: <CAFj8pRCyW4E5OnZDGvk_YnPqaS_PfK-VKJOKGndC-gtAtDOtBw@mail.gmail.com> (raw)
In-Reply-To: <CAFCRh-_iLoUtMAtyunw_-O6sgpWo04sOmB38MUVNpuQVSkL_0Q@mail.gmail.com>
References: <CAFCRh-_iLoUtMAtyunw_-O6sgpWo04sOmB38MUVNpuQVSkL_0Q@mail.gmail.com>

Hi

st 6. 8. 2025 v 19:49 odesílatel Dominique Devienne <[email protected]>
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 verify USAGE on the SCHEMA of the proc. OK.
> I verify EXECUTE on the FUNCTION. OK.
> I verify the names of the parameters, in my CALL with named arguments. OK.
>
> Turns out, thanks to ChatGPT for clueing me in, CALL does NOT support
> named parameters. And it's about the least helpful error message
> PostgreSQL could have provided IMO. I'd expect something much better
> in this specific case, FWIW.
>
> That's two unhelpful error messages in a short time :).
>
> Thanks, and again sorry for the rant. Wasted time on this. --DD
>

I think so ChatGPT is wrong

(2025-08-06 20:04:34) postgres=# create or replace procedure foo(a int, b
numeric)
postgres-# as $$ begin
postgres$#   raise notice 'a: %, b: %', a, b;
postgres$# end;
postgres$# $$ language plpgsql;
CREATE PROCEDURE
(2025-08-06 20:05:15) postgres=# call foo(10,20);
NOTICE:  a: 10, b: 20
CALL
(2025-08-06 20:05:20) postgres=# call foo(10,b=>20);
NOTICE:  a: 10, b: 20
CALL
(2025-08-06 20:05:26) postgres=# call foo(a=>10,b=>20);
NOTICE:  a: 10, b: 20
CALL
(2025-08-06 20:05:33) postgres=# create or replace procedure foo1(a int, b
numeric default 0.0)
as $$ begin
  raise notice 'a: %, b: %', a, b;
end;
$$ language plpgsql;
CREATE PROCEDURE
(2025-08-06 20:05:49) postgres=# call foo1(a=>10);
NOTICE:  a: 10, b: 0.0
CALL
(2025-08-06 20:05:57) postgres=# call foo(b=>20, a=>10);
NOTICE:  a: 10, b: 20
CALL
(2025-08-06 20:06:13) postgres=#

Maybe there is another issue?

Can you send an example?

Regards

Pavel


view thread (10+ messages)  latest in thread

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]
  Subject: Re: CALL and named parameters
  In-Reply-To: <CAFj8pRCyW4E5OnZDGvk_YnPqaS_PfK-VKJOKGndC-gtAtDOtBw@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