The function expects text as a parameter. Drop this:
SELECT request_id, md5(request_id::text)
FROM Request
ORDER BY request_id
A function named md5 that takes an integer parameter does not exist, but you can create it:
create function md5(integer)
returns text as $$
select md5($1::text);
$$ language sql immutable;
Then for md5 there will be 3 signatures:
=> \df md5
List of functions
Schema | Name | Result data type | Argument data types | Type
------------+------+------------------+---------------------+--------
pg_catalog | md5 | text | bytea | normal
pg_catalog | md5 | text | text | normal
public | md5 | text | integer | normal
, md5 , . , md5, bytea:
select md5(('\x' || right('0000000' || to_hex(200), 8))::bytea);
md5
b7b436d004c1cc0501bee9e296d2eaa4
:
create or replace function md5(integer)
returns text as $$
select md5(('\x' || right('0000000' || to_hex($1), 8))::bytea);
$$ language sql immutable;