How to convert PostgreSQL bytea HEX value to byte[] ?
Suliman via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Thu Apr 7 05:56:40 PDT 2016
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[]
More information about the Digitalmars-d-learn
mailing list