www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - How to convert PostgreSQL bytea HEX value to byte[] ?

I need to extract binary blob from PostgreSQL. It's input/output 
by default work in hex mode.

http://www.postgresql.org/docs/current/static/datatype-binary.html

I need to extract data and write them on FS as normal file (byte 
[] I suppose).

Here is my question on SO 
http://stackoverflow.com/questions/36469669/how-to-load-unload-binary-blob-from-postgresql-with-d

There I got suggestion to do:
  md.userblob = byteaToBytes(to!string(rs.getString(4)));

But as I understand after reading docs I am getting hex string 
and need convert it to byte[]
Apr 07 2016