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 B487A52C47 for ; Mon, 1 Aug 2005 08:32:43 -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 78042-10 for ; Mon, 1 Aug 2005 11:32:38 +0000 (GMT) Received: from smtp4.wanadoo.fr (smtp4.wanadoo.fr [193.252.22.27]) by svr1.postgresql.org (Postfix) with ESMTP id 2E7AA52C21 for ; Mon, 1 Aug 2005 08:32:37 -0300 (ADT) Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf0407.wanadoo.fr (SMTP Server) with ESMTP id C06B81C003F0 for ; Mon, 1 Aug 2005 13:32:39 +0200 (CEST) Received: from NSTMike (APoitiers-101-1-1-5.w193-251.abo.wanadoo.fr [193.251.25.5]) by mwinf0407.wanadoo.fr (SMTP Server) with ESMTP id 6DCFF1C003EF for ; Mon, 1 Aug 2005 13:32:39 +0200 (CEST) X-ME-UUID: 20050801113239449.6DCFF1C003EF@mwinf0407.wanadoo.fr Message-ID: <009001c5968c$b8f26b90$027ba8c0@NSTMike> Reply-To: "Michael GUIARD" From: "Michael GUIARD" To: References: <6BCB9D8A16AC4241919521715F4D8BCE6C77E7@algol.sollentuna.se> Subject: Re: retreive record set Date: Mon, 1 Aug 2005 13:32:34 +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.037 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200508/5 X-Sequence-Number: 3317 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" 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.