From: Jeroen Vermeulen <jtv@xs4all.nl>
To: Georges.Brefort@sanofi-aventis.com
Cc: pgsql-interfaces@postgresql.org
Subject: Re: Retrieving points, arrays, ... with libpq
Date: Wed, 22 Oct 2008 12:27:28 +0700
Message-ID: <48FEB9C0.7030608@xs4all.nl> (raw)
In-Reply-To: <AC1B5B770E3FD54A94DED61FA96B12C3E06A46@CLPW44.f2.enterprise>
References: <AC1B5B770E3FD54A94DED61FA96B12C3E06A46@CLPW44.f2.enterprise>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-interfaces@postgresql.org
Cc: jtv@xs4all.nl, Georges.Brefort@sanofi-aventis.com
Subject: Re: Retrieving points, arrays, ... with libpq
In-Reply-To: <48FEB9C0.7030608@xs4all.nl>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox