Re: [GENERAL] binary timestamp conversion
От | Michael Fuhr |
---|---|
Тема | Re: [GENERAL] binary timestamp conversion |
Дата | |
Msg-id | 20051015030926.GA22137@winnie.fuhr.org обсуждение исходный текст |
Ответ на | Re: [GENERAL] binary timestamp conversion (Tom Lane <tgl@sss.pgh.pa.us>) |
Список | pgsql-interfaces |
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
В списке pgsql-interfaces по дате отправления: