I got the same error when passingcreated a PL/pgSQL function with 3OUT toparameter as shown below::
CREATE FUNCTION my_func(OUT value INTEGER) AS $$
BEGIN -- ↑ ↑ ↑ Here ↑ ↑ ↑
END;
$$ LANGUAGE plpgsql;
Then, calling my_func(3) functiongot the same error as shown below because OUT parameter cannot get a value from the caller while it can return a value to the caller:
postgres=# SELECT my_func(3);
ERROR: function my_func(integer) does not exist
LINE 1: SELECT my_func(3);
^
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
Because I set the OUT parameter which cannot get a value from the caller but can return a value to the caller as shown below:
CREATE FUNCTION my_func(OUT value INTEGER) AS $$
BEGIN -- ↑ ↑ ↑ Here ↑ ↑ ↑
END;
$$ LANGUAGE plpgsql;
So, I set the INOUT parameter which can get a value from the caller and return a value to the caller as shown below, then the error was solved:
CREATE FUNCTION my_func(INOUT value INTEGER) AS $$
BEGIN -- ↑ ↑ ↑ Here ↑ ↑ ↑
END;
$$ LANGUAGE plpgsql;
Or, I set the IN parameter which can get a value from the caller but cannot return a value to the caller and RETURNS VOID as shown below, then the error was solved:
CREATE FUNCTION my_func(IN value INTEGER) RETURNS VOID AS $$
BEGIN -- ↑ ↑ ↑ Here ↑ ↑ ↑
END;
$$ LANGUAGE plpgsql;
Or, I set the parameter without IN keyword which is also recognized as an IN parameter and RETURNS VOID as shown below, then the error was solved:
CREATE FUNCTION my_func(value INTEGER) RETURNS VOID AS $$
BEGIN -- ↑ ↑ Here ↑ ↑ ↑ ↑ Here ↑ ↑
END;
$$ LANGUAGE plpgsql;