caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* binary data from Postgresql with cursors
@ 2006-01-24 18:28 Kenneth Sullivan
  2006-01-24 21:23 ` [Caml-list] " Markus Mottl
  0 siblings, 1 reply; 2+ messages in thread
From: Kenneth Sullivan @ 2006-01-24 18:28 UTC (permalink / raw)
  To: caml-list

	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?

Thanks,
Ken Sullivan


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Caml-list] binary data from Postgresql with cursors
  2006-01-24 18:28 binary data from Postgresql with cursors Kenneth Sullivan
@ 2006-01-24 21:23 ` Markus Mottl
  0 siblings, 0 replies; 2+ messages in thread
From: Markus Mottl @ 2006-01-24 21:23 UTC (permalink / raw)
  To: Kenneth Sullivan; +Cc: caml-list

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-01-24 21:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-24 18:28 binary data from Postgresql with cursors Kenneth Sullivan
2006-01-24 21:23 ` [Caml-list] " Markus Mottl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).