From: Jakob Lechner <jakob.lechner@applstrudl.com>
To: Wilhansen Li <willi.t1@gmail.com>
Cc: pgsql-interfaces@postgresql.org
Subject: Re: Timestamp with libpq
Date: Mon, 13 Oct 2008 11:57:23 +0200
Message-ID: <1223891843.3502.33.camel@vie063.fabagl.fabasoft.com> (raw)
In-Reply-To: <bc9549a50810130232nf40bfd2l2aee3c8c3ff5ec7e@mail.gmail.com>
References: <1223884381.3502.10.camel@vie063.fabagl.fabasoft.com>
<bc9549a50810130232nf40bfd2l2aee3c8c3ff5ec7e@mail.gmail.com>
Hello,
Am Montag, den 13.10.2008, 17:32 +0800 schrieb Wilhansen Li:
>
> Actually, I've done this before. And, uh, you can check out my blog
> for details:
>
>
> http://blogs.crammerz-inc.net/thunk/2007/05/09/grabbing_time_in_postgresql_using_libpq
I think I've seen your blog before. Your solution is reasonable but
unfortunately not feasible for me:
I'm writing a simple generic interface for accessing databases and thus
I need to cope with arbitrary SQL statements.
As I posted before I want to execute the statement
"select * from testtable" without any modifications and if there are
timestamp coloumns in the result set I want to convert the timestamp
values to unix time_t values.
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.
Can anybody figure out a reason for this behaviour?
Best regards
Jakob
--
Jakob Lechner
Research & Development
appl.strudl Software GmbH
Honauerstraße 4
A-4020 Linz
Tel.: [+43] (70) 60 61 62
Fax: [+43] (70) 60 61 62-609
E-Mail: jakob.lechner@applstrudl.com
Web: http://www.applstrudl.com
Handelsgericht Linz, FN 303988 t
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: jakob.lechner@applstrudl.com, willi.t1@gmail.com
Subject: Re: Timestamp with libpq
In-Reply-To: <1223891843.3502.33.camel@vie063.fabagl.fabasoft.com>
* 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