X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 34750D93C7 for ; Fri, 14 Oct 2005 17:00:15 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 84518-06 for ; Fri, 14 Oct 2005 20:00:04 +0000 (GMT) Received: from web52315.mail.yahoo.com (web52315.mail.yahoo.com [206.190.48.158]) by svr1.postgresql.org (Postfix) with SMTP id 703A7D76E9 for ; Fri, 14 Oct 2005 17:00:05 -0300 (ADT) Received: (qmail 89013 invoked by uid 60001); 14 Oct 2005 20:00:02 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=MK3Nv6EgXZUK8k0fzcynk5y3efCuaU2HG/eA3sDzxKtQ2v7uO4gWY0H1MyAaefRoHCuBxhjbey162YD+YDexokzBD4bFrRRkpzNfat0Q+1MKAqSDtd3iII0DtOpJeddY78Pa/nnl/KbVLWh6aDZvo+/oW7HgmfOhCekU0D0nm0M= ; Message-ID: <20051014200002.89011.qmail@web52315.mail.yahoo.com> Received: from [66.46.13.170] by web52315.mail.yahoo.com via HTTP; Fri, 14 Oct 2005 13:00:01 PDT Date: Fri, 14 Oct 2005 13:00:01 -0700 (PDT) From: H Hale Subject: Re: [GENERAL] binary timestamp conversion To: pgsql-interfaces@postgresql.org MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.953 required=5 tests=[AWL=0.063, DNS_FROM_RFC_ABUSE=0.374, FROM_ENDS_IN_NUMS=0.516] X-Spam-Level: X-Archive-Number: 200510/14 X-Sequence-Number: 5776 I originally incorrectly posted my question to the GENERAL list with the same subject. As I indicated in my original post I am trying to convert an binary timestamp (int64). After further experimentation I have yet to find a method to correctly convert the int64 value retrieved from a query. I save 1970-01-01 00:00:00 and read it back expecting the difference between postgres and unix epochs but get different results each time. (After conversion to host byte order). -946686612744257 -946684195712577 -946684196834881 I then tried using PGTYPEStimestamp_to_asc() just to see what it does and get.... 1969-12-31 23:07:28.818367 1969-12-31 23:38:40.464063 1969-12-31 23:52:03.009727 psql shows 1970-01-01 00:00:00 Using 2000-01-01 the minutes/seconds/fractional seconds varies as well. If request back dates formattea as strings, I get what psql shows, the correct result. Why would pg returning inconsistent binary timestampo results? Thanks __________________________________ Yahoo! Music Unlimited Access over 1 million songs. Try it free. http://music.yahoo.com/unlimited/