Re: BUG #4960: Unexpected timestamp rounding - Mailing list pgsql-bugs

From Kevin Grittner
Subject Re: BUG #4960: Unexpected timestamp rounding
Date
Msg-id 4A7315060200002500029269@gw.wicourts.gov
Whole thread Raw
In response to BUG #4960: Unexpected timestamp rounding  ("Matthias" <matthias.cesna@gmail.com>)
Responses Re: BUG #4960: Unexpected timestamp rounding  (Matthias Cesna <matthias.cesna@gmail.com>)
List pgsql-bugs
"Matthias" <matthias.cesna@gmail.com> wrote:

> I noticed an unusual (and from my point of view inconsistent)
> rounding of a timestamp:

What do you get when you run?:

show integer_datetimes;

If it is off, which is probably the default for your distribution
under 8.3.X, timestamps are floating point (approximate) values which
get less precise as you move away from the base timestamp of
'2000-01-01 00:00'.

The default under 8.4 is to use integer timestamps, which have a
microsecond precision across the range they support.  (That range is
not as broad as the floating point format, but plenty large for most
practical uses.)

You can configure PostgreSQL to use integer timestamps in 8.3 if you
build from source, but you will need to convert your database.

-Kevin

pgsql-bugs by date:

Previous
From: "Matthias"
Date:
Subject: BUG #4960: Unexpected timestamp rounding
Next
From: "Kevin Grittner"
Date:
Subject: Re: BUG #4960: Unexpected timestamp rounding