I have a server with PostgreSQL 8.1.23, with a function that works perfectly when it runs with postgres
user, but with another user shows the SQL STATE:
SQL state: 42883
This is my function:
CREATE OR REPLACE FUNCTION fun_validatepost(integer, integer)
RETURNS integer AS
$BODY$
...
$BODY$
LANGUAGE plpgsql VOLATILE;
ALTER FUNCTION fun_validatepost(integer, integer)
OWNER TO postgres;
GRANT EXECUTE ON FUNCTION fun_validatepost(integer, integer) TO public;
GRANT EXECUTE ON FUNCTION fun_validatepost(integer, integer) TO postgres;
GRANT EXECUTE ON FUNCTION fun_validatepost(integer, integer) TO someuser;
If I run this with postgres user like this:
select fun_validatepost(1,230465);
The result is like this:
-[ RECORD 1 ]-----------+--
fun_validatepost | 1
But if I execute the same query as someuser, shows me this message:
ERROR: function fun_validatepost(integer, integer) does not exist SQL state: 42883 HINT: No function matches the given name and argument types. You may need to add explicit type casts
Even if a do a explicit cast I get the same result:
select fun_validatepost from fun_validatepost(1::integer,230465::integer);
Same error message.
What can I do so someuser
can execute the same function?
Is there something wrong with my function or cast?