Re: Timestamp precision

From: "John D(dot) Burger" <john(at)mitre(dot)org>
To: Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Timestamp precision
Date: 2007-03-29 18:14:31
Message-ID: EA214ECE-5907-4C4A-B3FB-7F04AC07C759@mitre.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Merlin Moncure 2007-03-29 18:42:22 Re: load the whole database into RAM
Previous Message Oisin Glynn 2007-03-29 17:50:12 Re: Oracle to PSQL function