Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id A49DB9FB7AA for ; Wed, 23 May 2007 12:48:01 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 41575-10 for ; Wed, 23 May 2007 12:47:57 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from smtp103.rog.mail.re2.yahoo.com (smtp103.rog.mail.re2.yahoo.com [206.190.36.81]) by postgresql.org (Postfix) with SMTP id 54C4F9FB7D9 for ; Wed, 23 May 2007 12:47:57 -0300 (ADT) Received: (qmail 42614 invoked from network); 23 May 2007 15:47:56 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=rogers.com; h=Received:X-YMail-OSG:Message-ID:Date:From:User-Agent:MIME-Version:To:Subject:Content-Type:Content-Transfer-Encoding; b=cYftMXrV64fXwDpbJmhpYIrNiVoLmXAmWqcWM10+JpdJTnAK9TghoNyonEoTi/ZNBVpxNDSHIbHYGSeH53Mu9U5scOI1Vg5owhvJJ/gmDqiHwPhcTc7/lhKAEwmbtTM8mMDMonRxgKNCJfrP/osYEK/IzV8ZD9gZ79UXG/4Dmuw= ; Received: from unknown (HELO ?127.0.0.1?) (ymlam@rogers.com@216.209.33.106 with plain) by smtp103.rog.mail.re2.yahoo.com with SMTP; 23 May 2007 15:47:55 -0000 X-YMail-OSG: m21Vxt8VM1l8TjL3RbCJ2H9vj1GAx5K5OcXE8RV6ZGc50WycbjObHqdaD0wjyLsUiw-- Message-ID: <46546220.4060209@rogers.com> Date: Wed, 23 May 2007 11:47:44 -0400 From: Jeff Lynn User-Agent: Thunderbird 1.5.0.10 (Windows/20070221) MIME-Version: 1.0 To: pgsql-interfaces@postgresql.org Subject: Re: How do you convert PostgreSQL internal binary field to C datatypes Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200705/47 X-Sequence-Number: 6554 I give up! What ever data returned from the binary output of PGgetvalue() is, I don't know how to convert it into StringInfo, which is being used by a few routines that "seems" to convert internal binary format into float8. By casting the returned data into StringInfo, crashes the function. If PostgreSQL support only a half baked C API, may as well don't bother. So I gave up. I will not use PostgreSQL until there is a simple way to extract data directly into C or C++ data type. Is one expect to fetch data in text, then use text to int, text to double, text to date function before you can make any business logic works? Thanks all of you trying to help. Appreciated! Jeff