Skip site navigation (1) Skip section navigation (2)

Re: Timestamp with libpq

From: Michael Meskes <meskes(at)postgresql(dot)org>
To: Jakob Lechner <jakob(dot)lechner(at)applstrudl(dot)com>
Cc: Michael Meskes <meskes(at)postgresql(dot)org>,Wilhansen Li <willi(dot)t1(at)gmail(dot)com>, pgsql-interfaces(at)postgresql(dot)org
Subject: Re: Timestamp with libpq
Date: 2008-10-13 12:59:29
Message-ID: 20081013125929.GA23953@feivel.credativ.de (view raw or flat)
Thread:
Lists: pgsql-interfaces
> > Is there any reason to use a binary transfer? 
> 
> If I use textual transfer I'm losing precision. E.g. for timestamps the
> returned string from my table is "1955-06-08 00:00:00". Thus I'm
> restricted to timestamps with a granularity of 1 second.

I doubt this. It might be true for double storage but not for 8 byte integers,
well that is in the database of course. But I see no reason whatsoever that the
data is truncated by libpq. 

> > about using ecpg instead of libpq?
> 
> The generic database interface I'm writing is part of a basic library
> used in our project. The interface serves as an abstraction for
> accessing different database servers (Postgres, MSSQL, ...). I'm
> currently working on the postgres implementation of the interface. 
> As far as I've seen using ecpg means to hardcode SQL statements which of
> course can't be done in a generic library.

No, this is not true. You can execute arbitrary statements in ecpg as well.

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(at)jabber(dot)org
Go VfL Borussia! Go SF 49ers! Use Debian GNU/Linux! Use PostgreSQL!

In response to

Responses

pgsql-interfaces by date

Next:From: Jakob LechnerDate: 2008-10-13 15:43:50
Subject: Re: Timestamp with libpq
Previous:From: Jakob LechnerDate: 2008-10-13 12:34:02
Subject: Re: Timestamp with libpq

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group