X-Original-To: pgsql-hackers-win32-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id A43A552A07 for ; Mon, 1 Aug 2005 05:42:05 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 53144-02 for ; Mon, 1 Aug 2005 08:41:53 +0000 (GMT) Received: from smtp4.wanadoo.fr (smtp4.wanadoo.fr [193.252.22.27]) by svr1.postgresql.org (Postfix) with ESMTP id 8987952801 for ; Mon, 1 Aug 2005 05:41:49 -0300 (ADT) Received: from me-wanadoo.net (unknown [127.0.0.1]) by mwinf0409.wanadoo.fr (SMTP Server) with ESMTP id 44A731C003B3 for ; Mon, 1 Aug 2005 10:41:48 +0200 (CEST) Received: from NSTMike (APoitiers-101-1-1-5.w193-251.abo.wanadoo.fr [193.251.25.5]) by mwinf0409.wanadoo.fr (SMTP Server) with ESMTP id D23A11C00393; Mon, 1 Aug 2005 10:41:47 +0200 (CEST) X-ME-UUID: 20050801084147861.D23A11C00393@mwinf0409.wanadoo.fr Message-ID: <004001c59674$daade790$027ba8c0@NSTMike> Reply-To: "Michael GUIARD" From: "Michael GUIARD" To: "Magnus Hagander" Cc: References: <6BCB9D8A16AC4241919521715F4D8BCE6C77E7@algol.sollentuna.se> Subject: Re: retreive record set Date: Mon, 1 Aug 2005 10:41:44 +0200 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2527 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.049 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200508/4 X-Sequence-Number: 3316 Hi Magnus, 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. 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 ... what is your advices about this ? thanks a lot Mike ----- Original Message ----- From: "Magnus Hagander" To: "Michael GUIARD" ; 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.