Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 048BF9FB6F6 for ; Wed, 23 May 2007 16:41:05 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 21413-08 for ; Wed, 23 May 2007 16:40:55 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from smtp-vbr10.xs4all.nl (smtp-vbr10.xs4all.nl [194.109.24.30]) by postgresql.org (Postfix) with ESMTP id 1BBAF9FB6DE for ; Wed, 23 May 2007 16:40:57 -0300 (ADT) Received: from webmail.xs4all.nl (dovemail12.xs4all.nl [194.109.26.14]) by smtp-vbr10.xs4all.nl (8.13.8/8.13.8) with ESMTP id l4NJekoj060393; Wed, 23 May 2007 21:40:50 +0200 (CEST) (envelope-from jtv@xs4all.nl) Received: from 125.24.219.252 (SquirrelMail authenticated user jtv) by webmail.xs4all.nl with HTTP; Thu, 24 May 2007 02:35:31 +0700 (ICT) Message-ID: <23494.125.24.219.252.1179948931.squirrel@webmail.xs4all.nl> In-Reply-To: <46546220.4060209@rogers.com> References: <46546220.4060209@rogers.com> Date: Thu, 24 May 2007 02:35:31 +0700 (ICT) Subject: Re: How do you convert PostgreSQL internal binary field to C datatypes From: "Jeroen T. Vermeulen" To: "Jeff Lynn" Cc: pgsql-interfaces@postgresql.org User-Agent: SquirrelMail/1.4.8 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Virus-Scanned: by XS4ALL Virus Scanner X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200705/49 X-Sequence-Number: 6556 On Wed, May 23, 2007 22:47, Jeff Lynn wrote: > 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? If you're working in C++ (as opposed to C, which I for one thought you were using) then it's really easy. As one example of the C++ API, if you have a result set "data" and you want to extract an integer value at row r, column c: int x = data[r][c].as(); See http://pqxx.org/ for more on the C++ API. Jeroen