0
votes

Even though i tried different variants and searched internet could not found a way to resolve this ? My function call is

select get_byte( md5('key')::text , 0);

Does not work.

According to this http://www.postgresql.org/docs/9.1/static/functions-string.html md5 take string input and produce text while get_byte expect string input ( http://www.postgresql.org/docs/8.0/static/functions-binarystring.html ) . What am i missing here ? Error is HINT: No function matches the given name and argument types. You might need to add explicit type casts.

1

1 Answers

1
votes

You need to cast the md5 return value to bytea, not text:

> SELECT get_byte(MD5('key')::bytea, 0);
 get_byte
----------
       51
(1 row)