Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id B70A064FCE0 for ; Wed, 22 Oct 2008 02:27:46 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 81067-01 for ; Wed, 22 Oct 2008 02:27:44 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from smtp-vbr14.xs4all.nl (smtp-vbr14.xs4all.nl [194.109.24.34]) by postgresql.org (Postfix) with ESMTP id D76E264FCDA for ; Wed, 22 Oct 2008 02:27:43 -0300 (ADT) Received: from [192.168.1.100] (125.25.93.123.adsl.dynamic.totbb.net [125.25.93.123]) (authenticated bits=0) by smtp-vbr14.xs4all.nl (8.13.8/8.13.8) with ESMTP id m9M5RZI1046048 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 22 Oct 2008 07:27:41 +0200 (CEST) (envelope-from jtv@xs4all.nl) Message-ID: <48FEB9C0.7030608@xs4all.nl> Date: Wed, 22 Oct 2008 12:27:28 +0700 From: Jeroen Vermeulen User-Agent: Thunderbird 2.0.0.17 (X11/20080925) MIME-Version: 1.0 To: Georges.Brefort@sanofi-aventis.com CC: pgsql-interfaces@postgresql.org Subject: Re: Retrieving points, arrays, ... with libpq References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by XS4ALL Virus Scanner X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200810/11 X-Sequence-Number: 6812 Georges.Brefort@sanofi-aventis.com wrote: > I have read the most recent documentation from the first to the very > last line, and I guess I can retreive data of any type with the > PQgetValue() function, something like: > > char* chunkOfMemory = PQgetvalue( (const PGresult*) myresult, > row_number, column_number); > > But then, is it possible to cast the char* pointer to some meaningfull C > structure if column_number relates to some datatype other than text or > integer ? By default, you get your data in a textual representation. So you need to parse the string that that char* points to. (It's also possible to work in binary mode, but then you've got a lot more worries about portability and such for not much gain in speed.) Jeroen