pg.ddx.io  pgsql-hackers-win32@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael GUIARD <michael@nestor-tech.com>
To: pgsql-hackers-win32@postgresql.org
Subject: Re: retreive record set
Date: Mon, 1 Aug 2005 13:32:34 +0200
Message-ID: <009001c5968c$b8f26b90$027ba8c0@NSTMike> (raw)
References: <6BCB9D8A16AC4241919521715F4D8BCE6C77E7@algol.sollentuna.se>

I understood that I am not supposed to know how PGresult stores the data, 
but I do not know how to fill my structure directly rather than to fill it 
field by field using conversion.
I saw ecpg gives methods to do this (with descriptors), but I do not 
understand all about it, and I think it is too complicated for my small 
needs. Further, I do not want to change the implementation of postgreqsl 
libpq.

So if I have no other choice than convert all result fields to fill my 
structure I will do this ...

...any advices ?

thanks a lot
Mike

----- Original Message ----- 
From: "Magnus Hagander" <mha@sollentuna.net>
To: "Michael GUIARD" <m.guiard@nestor-tech.com>; 
<pgsql-hackers-win32@postgresql.org>
Sent: Monday, August 01, 2005 10:03 AM
Subject: RE: [pgsql-hackers-win32] retreive record set


> Hi !
>
> I'd like to get my request results in a record set as a C
> structure using libpq.
> Is it possible or do I have to use ECPG only ?
>
> How PGresult pointer stores the results ?
> Actually I can convert all my result fields from PGresult to
> my C structure but I think also it is a little bit stupid if
> PGresult does its own conversion before ... no ?

You are not suppsed to know how PGresult stores the data, you are only
permitted to access it through the accessor functions. This is so it's
possible to change the underlying implementation without breaking your
apps...

You *can* access the data directly, all the rqeuired structs are in the
include files (but not in the libpq-fe.h file - you need the full
includes). I would stronly advise you not to, though.

//Magnus
---------------------------------------------------------------------------------------
Wanadoo vous informe que cet  e-mail a ete controle par l'anti-virus mail.
Aucun virus connu a ce jour par nos services n'a ete detecte.







view thread (5+ messages)  latest in thread

Message-ID: <009001c5968c$b8f26b90$027ba8c0@NSTMike>
Permalink:  ../009001c5968c$b8f26b90$027ba8c0@NSTMike/
Also on:    postgresql.org/message-id/009001c5968c$b8f26b90$027ba8c0@NSTMike

 · 

reply

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers-win32@postgresql.org
  Cc: michael@nestor-tech.com
  Subject: Re: retreive record set
  In-Reply-To: <009001c5968c$b8f26b90$027ba8c0@NSTMike>
  References: <6BCB9D8A16AC4241919521715F4D8BCE6C77E7@algol.sollentuna.se> <009001c5968c$b8f26b90$027ba8c0@NSTMike>

* 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