X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id AA2E453485 for ; Thu, 31 Mar 2005 04:29:12 +0100 (BST) 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 60666-06 for ; Thu, 31 Mar 2005 03:29:03 +0000 (GMT) Received: from smtp-vbr2.xs4all.nl (smtp-vbr2.xs4all.nl [194.109.24.22]) by svr1.postgresql.org (Postfix) with ESMTP id 48FBF52956 for ; Thu, 31 Mar 2005 04:29:02 +0100 (BST) Received: from webmail.xs4all.nl (webmail12.xs4all.nl [194.109.22.172]) by smtp-vbr2.xs4all.nl (8.12.11/8.12.11) with ESMTP id j2V3T4PN051161; Thu, 31 Mar 2005 05:29:04 +0200 (CEST) (envelope-from jtv@xs4all.nl) Received: from 202.47.227.25 by webmail.xs4all.nl with HTTP; Thu, 31 Mar 2005 05:29:04 +0200 (CEST) Message-ID: <24826.202.47.227.25.1112239744.squirrel@202.47.227.25> In-Reply-To: <424ADDC0.8070603@innovision.com> References: <424ADDC0.8070603@innovision.com> Date: Thu, 31 Mar 2005 05:29:04 +0200 (CEST) Subject: Re: libpq: Newbie help w/ data type conversions on From: jtv@xs4all.nl To: "Marvin Bellamy" Cc: pgsql-interfaces@postgresql.org User-Agent: SquirrelMail/1.4.3a X-Mailer: SquirrelMail/1.4.3a MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Virus-Scanned: by XS4ALL Virus Scanner X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.228 tagged_above=0 required=5 tests=AWL, FORGED_RCVD_HELO, NO_REAL_NAME X-Spam-Level: X-Archive-Number: 200503/86 X-Sequence-Number: 5415 > I'm coming from a Java background, so I'm relatively new to C/C++ in > general. I want to convert the data retrieved from a field to an > "external" data type I can use; specifically a datetime or a timestamp. > It looks like the only option for retrieving field data is as raw bytes, > but I haven't found any information on mapping those byte streams to > structures. Actually, values are delivered as C-style strings by default. So it may help get a feel for things if you print a few of them out to the console. > Also, is there any sort of a libpq API, or are you just stuck with > perusing header files? In C and C++, header files are normally the way to define an API. > I had zero luck following the build instructions for libpqxx on Windows, > so it looks like libpq is my only option for now. Perhaps that can be fixed. What problems did you run into, and using which compiler exactly? Jeroen