From: Adrian Klaver <adrian.klaver@aklaver.com>
To: arons <arons7@gmail.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: No function matches the given name and argument types.
Date: Mon, 16 Jan 2023 08:21:45 -0800
Message-ID: <7ffc7bbe-9365-e31b-3d6f-2ad388bdc6a5@aklaver.com> (raw)
In-Reply-To: <2418e79e-a2ca-6fa5-205b-8b39dbf9ffec@aklaver.com>
References: <CA+XOKQBOGd_wd8aaUxoKt7GNruHd=5cKN4uQicX7oBmDMk9kDA@mail.gmail.com>
<2418e79e-a2ca-6fa5-205b-8b39dbf9ffec@aklaver.com>
On 1/16/23 08:17, Adrian Klaver wrote:
> On 1/16/23 08:04, arons wrote:
>> Dear All,
>> I'm facing a general problem and I'm looking the best, fastest, way
>> how to identify the problem and solve it.
>>
>> As example assume we have a function like that:
>>
>> CREATE OR REPLACE FUNCTION testBinding01 (
>>
>> p_in01 bigint,
>>
>> p_in02 bigint,
>>
>> p_in03 bigint,
>>
>> p_in04 bigint,
>>
>> p_in05 bigint,
>>
>> p_in06 bigint,
>>
>> p_text7 text
>>
>> ) RETURNS text
>>
>> LANGUAGE sql
>>
>> AS $$
>>
>> select 'ciao';
>>
>> $$;
>>
>>
>>
>> I can call the function in some of the variant below:
>>
>> select testBinding01(1,2,3,4,5,6,7);
>>
>> select testBinding01(p_in01 => 1,p_in02 => 2,p_in03 => 3,p_in04 =>
>> 4,p_in05 => 5,p_in06 => 6,p_text7 => 7);
>>
>> select testBinding01(p_in01 => 1,p_in02 => 2,p_in03 => 3,p_in04 =>
>> 4,p_in05 => 5,p_in06 => 6,p_text9 => 'some txt');
>>
>>
>> All of the above, produce the error:
>>
>> *No function matches the given name and argument types.*
>
> In psql what does:
>
> \df test*
>
> return for the function name.
>
> I'm going to guess it might be testBinding01, in other words mixed case.
>
> Have you tried?:
>
> select "testBinding01"(1,2,3,4,5,6,7);
Forget the above. Instead:
select testBinding01(1,2,3,4,5,6,7);
ERROR: function testbinding01(integer, integer, integer, integer,
integer, integer, integer) does not exist
LINE 1: select testBinding01(1,2,3,4,5,6,7);
select testBinding01(1,2,3,4,5,6,'7');
testbinding01
---------------
ciao
The complete error shows what the function is receiving, all integers
when it needs a text parameter for the last value.
>> *
>> *
>> *
>> *
>> *
>> *
>> My question is: how is the best way to identify the problem?
>>
>> Is a parameter name? is a parameter type? is the function name?
>>
>> An especially in case is a parameter type how is the easy way to
>> identify which parameter is causing the problem?
>>
>> In case a function has a lot of parameters (and in even worst case has
>> some overloading) going trough all parameters to check its type/name
>> costs a lot of time.
>>
>>
>> Thanks for any help
>>
>> Renzo
>>
>>
>>
>
--
Adrian Klaver
adrian.klaver@aklaver.com
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: adrian.klaver@aklaver.com, arons7@gmail.com
Subject: Re: No function matches the given name and argument types.
In-Reply-To: <7ffc7bbe-9365-e31b-3d6f-2ad388bdc6a5@aklaver.com>
References: <CA+XOKQBOGd_wd8aaUxoKt7GNruHd=5cKN4uQicX7oBmDMk9kDA@mail.gmail.com> <2418e79e-a2ca-6fa5-205b-8b39dbf9ffec@aklaver.com> <7ffc7bbe-9365-e31b-3d6f-2ad388bdc6a5@aklaver.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox