Re: Timestamp precision - Mailing list pgsql-general

From John D. Burger
Subject Re: Timestamp precision
Date
Msg-id EA214ECE-5907-4C4A-B3FB-7F04AC07C759@mitre.org
Whole thread Raw
In response to Timestamp precision  (Stéphane Schildknecht<stephane.schildknecht@postgresqlfr.org>)
Responses Re: Timestamp precision  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
> Note:  When timestamp values are stored as double precision
> floating-point numbers (currently the default), the effective limit of
> precision may be less than 6. timestamp values are stored as seconds
> before or after midnight 2000-01-01. Microsecond precision is achieved
> for dates within a few years of 2000-01-01, but the precision degrades
> for dates further away. When timestamp values are stored as eight-byte
> integers (a compile-time option), microsecond precision is available
> over the full range of values.

I think this variance in precision is actually kind of cool - any
thought to allowing the "center" of the range to be a build-time
option?  That is, any particular application might want more
precision at a custom center.  Does this involve changing more than
that one constant?

Hmm, except if the timestamp "anchor" is installation-specific, then
binary exchange of timestamps is complicated.  What does libpq do now
with timetamps, if the client requests data in binary form?  How does
the client know whether it's getting floats or integers?

- John D. Burger
   MITRE



pgsql-general by date:

Previous
From: David Fetter
Date:
Subject: Re: Oracle to PSQL function
Next
From: Oisin Glynn
Date:
Subject: Re: Oracle to PSQL function