Re: Current code for function j2date does not have the same correct dynamic range as older code. - Mailing list pgsql-hackers

From Dann Corbit
Subject Re: Current code for function j2date does not have the same correct dynamic range as older code.
Date
Msg-id D425483C2C5C9F49B5B7A41F8944154701000B22@postal.corporate.connx.com
Whole thread Raw
List pgsql-hackers
From: Dann Corbit
Sent: Tuesday, December 11, 2007 5:58 PM
To: pgsql-hackers@postgresql.org
Subject: Current code for function j2date does not have the
same correct dynamic range as older code.
> It may not matter to the PostgreSQL group, since nothing goes
> wrong until the year is 1,465,002 or larger.  It may also be
> an artifact of the Microsoft Visual C++ compiler.  At any
> rate, the modular math to compute the year month and day do
> not remain accurate nearly as long for the new code as the
> old.  The old code here is j2dateOld(), and the new code is
> j2dateNew3().  I made a few tests with other internal types to
> try to extend the range of the new code, but neither long long
> or using mostly unsigned seems to restore the old range
> because the mathematics are not identical.  At any rate, here
> is a unit test driver you can fiddle with, if you so choose.

Correction:
It is the new routines that are sound.  The old routines had overflow
problems.

So *cough* nevermind.
[snip of code]


pgsql-hackers by date:

Previous
From: "Joshua D. Drake"
Date:
Subject: Re: VLDB Features
Next
From: Simon Riggs
Date:
Subject: Recreating archive_status