pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Meskes <meskes@postgresql.org>
To: Jakob Lechner <jakob.lechner@applstrudl.com>
Cc: Wilhansen Li <willi.t1@gmail.com>
Cc: pgsql-interfaces@postgresql.org
Subject: Re: Timestamp with libpq
Date: Mon, 13 Oct 2008 12:46:27 +0200
Message-ID: <20081013104627.GA23971@feivel.credativ.de> (raw)
In-Reply-To: <1223891843.3502.33.camel@vie063.fabagl.fabasoft.com>
References: <1223884381.3502.10.camel@vie063.fabagl.fabasoft.com>
	<bc9549a50810130232nf40bfd2l2aee3c8c3ff5ec7e@mail.gmail.com>
	<1223891843.3502.33.camel@vie063.fabagl.fabasoft.com>

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!



view thread (7+ messages)  latest in thread

Message-ID: <20081013104627.GA23971@feivel.credativ.de>
Permalink:  ../20081013104627.GA23971@feivel.credativ.de/
Also on:    postgresql.org/message-id/20081013104627.GA23971@feivel.credativ.de

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: meskes@postgresql.org, jakob.lechner@applstrudl.com, willi.t1@gmail.com
  Subject: Re: Timestamp with libpq
  In-Reply-To: <20081013104627.GA23971@feivel.credativ.de>

* 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