SQL ERROR: ERROR: structure of query does not match function result type DETAIL: Returned type bigint does not match expected type integer in column 10. CONTEXT: PL/pgSQL function mis.return_from_name(character varying,integer) line 23 at RETURN QUERY