On Tue, Aug 18, 2009 at 06:00, hubert depesz lubaczewski<dep...@depesz.com> wrote: > Hi, > tried on latest 8.5, and some 8.3: > # select '4817191.623 ms'::interval; > interval > ------------------ > -00:35:47.483648 > (1 row) > > I am pretty sure the answer is wrong. But why?
It only happens if you have integer date times on... seems to have gotten introduced by http://archives.postgresql.org/pgsql-committers/2008-03/msg00406.php Im thinking the fact that fsec_t is now an int32 on INT64_TIMESTAMP builds was a typo/thinko... its really supposed to be int64. With the attached patch it works correctly and fails with 'out of range' when its actually out of range.
*** a/src/include/utils/timestamp.h --- b/src/include/utils/timestamp.h *************** *** 46,52 **** typedef int64 Timestamp; typedef int64 TimestampTz; typedef int64 TimeOffset; ! typedef int32 fsec_t; /* fractional seconds (in microseconds) */ #else typedef double Timestamp; --- 46,52 ---- typedef int64 Timestamp; typedef int64 TimestampTz; typedef int64 TimeOffset; ! typedef int64 fsec_t; /* fractional seconds (in microseconds) */ #else typedef double Timestamp;
-- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs