• Register
+1 vote
59 views

Problem :

Getting following error while executing function
no function matches the given name and argument types. you might need to add explicit type casts.
by (6.9k points)  

1 Answer

0 votes

Solution :

Error message says that a function call is only matched by an existing function if all its arguments are of the same type and passed in same order. 

So suppose if the next f() function

create function f() returns integer as $$ 
    select 1;
$$ language sql;

is called as

select f(1);

It will throw error out with

ERROR:  function f(integer) does not exist
LINE 1: select f(1);
               ^
So no function matches the given name and argument types. You might need to add explicit type casts.

because there is no f() function that takes an integer as argument.

So you need to carefully compare what you are passing to the function to what it is expecting. 

by (36.1k points)  
...