Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

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: 2006-01-24 (21:23)
From: Markus Mottl <markus.mottl@g...>
Subject: Re: [Caml-list] binary data from Postgresql with cursors
On 1/24/06, Kenneth Sullivan <> 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!


Markus Mottl