pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Fuhr <mike@fuhr.org>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: H Hale <hhale21@yahoo.com>
Cc: pgsql-interfaces@postgresql.org
Subject: Re: [GENERAL] binary timestamp conversion
Date: Fri, 14 Oct 2005 21:09:26 -0600
Message-ID: <20051015030926.GA22137@winnie.fuhr.org> (raw)
In-Reply-To: <7448.1129323875@sss.pgh.pa.us>
References: <20051014200002.89011.qmail@web52315.mail.yahoo.com>
	<7448.1129323875@sss.pgh.pa.us>

On Fri, Oct 14, 2005 at 05:04:35PM -0400, Tom Lane wrote:
> H Hale <hhale21@yahoo.com> writes:
> > 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).
> 
> Sounds to me like you're picking up garbage rather than the data you
> should.

Dunno if this is significant, but the garbage appears to be confined
to the lower 32 bits, at least in the three examples given:

test=> select val, to_hex(val) from foo;
       val        |      to_hex      
------------------+------------------
 -946686612744257 | fffca2fe58bbd7bf
 -946684195712577 | fffca2fee8ccd1bf
 -946684196834881 | fffca2fee8bbb1bf

> Does your code to fetch the binary value produce correct answers
> on an ordinary int8 column?

Could we see the code?  A minimal but complete program that somebody
else could compile and run might be revealing.

-- 
Michael Fuhr



view thread (5+ messages)

Message-ID: <20051015030926.GA22137@winnie.fuhr.org>
Permalink:  ../20051015030926.GA22137@winnie.fuhr.org/
Also on:    postgresql.org/message-id/20051015030926.GA22137@winnie.fuhr.org

 · 

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: mike@fuhr.org, tgl@sss.pgh.pa.us, hhale21@yahoo.com
  Subject: Re: [GENERAL] binary timestamp conversion
  In-Reply-To: <20051015030926.GA22137@winnie.fuhr.org>

* 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