Version française
Home     About     Download     Resources     Contact us    
Browse thread
binary data from Postgresql with cursors
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Markus Mottl <markus.mottl@g...>
Subject: Re: [Caml-list] binary data from Postgresql with cursors
On 1/24/06, Kenneth Sullivan <sullivan@mayachitra.com> wrote:
>         Hi, I'm trying to pull binary data out of a postgresql database with
> the Postgresql module.  In postgresql, CURSORs have a binary option,
> which skips the usual conversion to text (which must be converted
> back).  However the module methods for getting data from a result,
> e.g. get_tuple, getvalue, all return string types, with no
> straightforward way to get ints and floats.  Has anyone else ran into
> this?

Ok, I've just uploaded an improved version, which can also handle
binary data in "getvalue" (untested!).  If you want to convert the
binary data directly in C, i.e. without going through OCaml-strings,
you will have to extend the C-interface.  I'm too busy right now to do
it myself, but I'll gladly accept patches :-)

If you send a patch, please make sure that error handling is
implemented, too. - Thanks!

Regards,
Markus

--
Markus Mottl        http://www.ocaml.info        markus.mottl@gmail.com