Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 92EC864FC08 for ; Mon, 13 Oct 2008 08:16:33 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 33851-04 for ; Mon, 13 Oct 2008 08:16:28 -0300 (ADT) X-Greylist: delayed 00:26:58.103561 by SQLgrey-1.7.6 Received: from gauss.credativ.com (gauss.credativ.com [212.112.227.254]) by postgresql.org (Postfix) with ESMTP id CA8A264FD03 for ; Mon, 13 Oct 2008 08:16:26 -0300 (ADT) Received: from feivel (exit.credativ.com [87.139.82.80]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by gauss.credativ.com (Postfix) with ESMTP id 40893774F3; Mon, 13 Oct 2008 12:49:19 +0200 (CEST) Received: by feivel (Postfix, from userid 1000) id 67BEBD6C60; Mon, 13 Oct 2008 12:46:27 +0200 (CEST) Date: Mon, 13 Oct 2008 12:46:27 +0200 From: Michael Meskes To: Jakob Lechner Cc: Wilhansen Li , pgsql-interfaces@postgresql.org Subject: Re: Timestamp with libpq Message-ID: <20081013104627.GA23971@feivel.credativ.de> Mail-Followup-To: Jakob Lechner , Wilhansen Li , pgsql-interfaces@postgresql.org References: <1223884381.3502.10.camel@vie063.fabagl.fabasoft.com> <1223891843.3502.33.camel@vie063.fabagl.fabasoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1223891843.3502.33.camel@vie063.fabagl.fabasoft.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200810/6 X-Sequence-Number: 6807 On Mon, Oct 13, 2008 at 11:57:23AM +0200, Jakob Lechner wrote: > I just wonder why my conversion routine for the binary timestamps > returned from a postgres server running on RHEL works while it's not for > a SLES server. Apparently the same SQL statement executed by exactly the > same libpq API calls produces different results for the two postgres > servers, one running on RHEL and another on SLES. Both postgres servers > basically have the same version (8.1.4). The program that executes the > SQL statement runs on my workstation and either connects to my RHEL > server or to my SLES machine. Please keep in mind that there is no guarantee that your server sends a double in a binary query. This depens on whether integer-datatypes are configure or not. Or in other words, it might be a long long instead of a double. Is there any reason to use a binary transfer? I would not recommend this in a general setup. If you just want to avoid some ascii translation hassle, how about using ecpg instead of libpq? It will take care of everything you need. Michael -- Michael Meskes Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org) Michael at BorussiaFan dot De, Meskes at (Debian|Postgresql) dot Org ICQ: 179140304, AIM/Yahoo: michaelmeskes, Jabber: meskes@jabber.org Go VfL Borussia! Go SF 49ers! Use Debian GNU/Linux! Use PostgreSQL!