I need to call the function which has cid ass attribute from jdbc. The documentation says about type cid - "Command identifiers are also 32-bit quantities." I create simple function with cid
CREATE OR REPLACE FUNCTION simplecid(in_param cid)
RETURNS VOID
LANGUAGE plpgsql
AS $function$
BEGIN
RAISE NOTICE 'Test cidtype';
END;
$function$;
I'm trying to call this from the console. SELECT "simplecid"(123); And i get this error:
: ERROR: function simplecid(integer) does not exist No function matches the given name and argument types. You might need to add explicit type casts.
I'm trying to do an explicit cast: SELECT "sa_db_test.simplecid"(cast(1 as cid));
SQL Error [42846]: ERROR: cannot cast type integer to cid
I'm try to use another type. SELECT "simplecid"(cast('a' as cid));
SQL Error [42883]: ERROR: function simplecid(cid) does not exist No function matches the given name and argument types. You might need to add explicit type casts.
Also i tried call it from jdbc and i have the same error:
CallableStatement callableStatement = conn.prepareCall("{ call sa_db_test.simplecid(?) }");
callableStatement.setLong(1, 34L);
callableStatement.execute();
I get this:
Exception in thread "main" org.postgresql.util.PSQLException: ERROR: function sa_db_test.simplecid(bigint) does not exist No function matches the given name and argument types. You might need to add explicit type casts.