Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 4B57364FD15 for ; Mon, 13 Oct 2008 10:03:34 -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 55688-07; Mon, 13 Oct 2008 10:03:27 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from gauss.credativ.com (gauss.credativ.com [212.112.227.254]) by postgresql.org (Postfix) with ESMTP id CA17264FD09; Mon, 13 Oct 2008 10:03:27 -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 F2AEF77510; Mon, 13 Oct 2008 15:03:23 +0200 (CEST) Received: by feivel (Postfix, from userid 1000) id 3C5EFD6C60; Mon, 13 Oct 2008 14:59:29 +0200 (CEST) Date: Mon, 13 Oct 2008 14:59:29 +0200 From: Michael Meskes To: Jakob Lechner Cc: Michael Meskes , Wilhansen Li , pgsql-interfaces@postgresql.org Subject: Re: Timestamp with libpq Message-ID: <20081013125929.GA23953@feivel.credativ.de> Mail-Followup-To: Jakob Lechner , Michael Meskes , Wilhansen Li , pgsql-interfaces@postgresql.org References: <1223884381.3502.10.camel@vie063.fabagl.fabasoft.com> <1223891843.3502.33.camel@vie063.fabagl.fabasoft.com> <20081013104627.GA23971@feivel.credativ.de> <1223901242.3502.54.camel@vie063.fabagl.fabasoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1223901242.3502.54.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/8 X-Sequence-Number: 6809 > > 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@jabber.org Go VfL Borussia! Go SF 49ers! Use Debian GNU/Linux! Use PostgreSQL!