From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 2E231BBBB for ; Tue, 24 Jan 2006 22:23:54 +0100 (CET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id k0OLNrh4015974 for ; Tue, 24 Jan 2006 22:23:53 +0100 Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id WAA20095 for ; Tue, 24 Jan 2006 22:23:53 +0100 (MET) Received: from xproxy.gmail.com (xproxy.gmail.com [66.249.82.198]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id k0OLNqPr015971 for ; Tue, 24 Jan 2006 22:23:52 +0100 Received: by xproxy.gmail.com with SMTP id h28so1588375wxd for ; Tue, 24 Jan 2006 13:23:51 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=sKTQlGjTUCsNFW9JXoLI69IAZqiMUmYSKJfsIfiIBO8RkvEKeAP5BXRt1S1FfGtdL2r7byfZmfNooG0Lv26dNDagTXjZT2JZ1FQF61Kl8CvF4sKHUFH1BI/iKLUk1v+Qg6XIsk1RwEpD4eSJ2C8/siUg8g9R5Wpt3rRArsqHHpo= Received: by 10.70.132.1 with SMTP id f1mr3095589wxd; Tue, 24 Jan 2006 13:23:51 -0800 (PST) Received: by 10.70.56.9 with HTTP; Tue, 24 Jan 2006 13:23:51 -0800 (PST) Message-ID: Date: Tue, 24 Jan 2006 16:23:51 -0500 From: Markus Mottl To: Kenneth Sullivan Subject: Re: [Caml-list] binary data from Postgresql with cursors Cc: caml-list@inria.fr In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: X-Miltered: at nez-perce with ID 43D69AE9.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 43D69AE8.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; markus:01 mottl:01 markus:01 mottl:01 caml-list:01 binary:01 binary:01 c-interface:01 ocaml:01 kenneth:98 wrote:01 ints:01 data:02 data:02 tuple:02 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.5 required=5.0 tests=INFO_TLD,RCVD_BY_IP autolearn=disabled version=3.0.3 On 1/24/06, Kenneth Sullivan wrote: > Hi, I'm trying to pull binary data out of a postgresql database w= ith > 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