Re: BUG #4789: ERROR 22008 on timestamp import - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #4789: ERROR 22008 on timestamp import
Date
Msg-id 15728.1241200175@sss.pgh.pa.us
Whole thread Raw
In response to BUG #4789: ERROR 22008 on timestamp import  ("Robert Kruuus" <robert.kruus@gov.sk.ca>)
Responses Re: BUG #4789: ERROR 22008 on timestamp import
List pgsql-bugs
"Robert Kruuus" <robert.kruus@gov.sk.ca> writes:
> More generally, even
> SELECT '1999-08-06 00:12:57.9999999Z'::timestamp with time zone; will throw
> the same error, so it seems to be something in the way Postgres
> rounds/truncates the field.

Hmph.  Is your installation built with --enable-integer-datetimes?
(Try "show integer_datetimes;" if you're not sure.)

On my devel machine, I get this in 8.3

regression=# select '1999-08-06 00:12:57.999999900Z'::timestamptz;
      timestamptz
------------------------
 1999-08-05 20:12:58-04
(1 row)

and this in 8.4

regression=# select '1999-08-06 00:12:57.999999900Z'::timestamptz;
ERROR:  date/time field value out of range: "1999-08-06 00:12:57.999999900Z"
LINE 1: select '1999-08-06 00:12:57.999999900Z'::timestamptz;
               ^

but I bet it's the change in the default integer_datetimes setting
that is the relevant difference.

            regards, tom lane

pgsql-bugs by date:

Previous
From: "Robert Kruuus"
Date:
Subject: BUG #4789: ERROR 22008 on timestamp import
Next
From: "Kevin Grittner"
Date:
Subject: Re: BUG #4789: ERROR 22008 on timestamp import