Re: Remove dependence on integer wrapping - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Remove dependence on integer wrapping
Date
Msg-id 626812.1717988598@sss.pgh.pa.us
Whole thread Raw
In response to Re: Remove dependence on integer wrapping  (Nathan Bossart <nathandbossart@gmail.com>)
List pgsql-hackers
Nathan Bossart <nathandbossart@gmail.com> writes:
> On Sun, Jun 09, 2024 at 09:57:54PM -0400, Tom Lane wrote:
>> I think you could replace the whole thing by using overflow-aware
>> multiplication and addition primitives in the result calculation.

> I was still confused by the comment about 1999, but I tracked it down to
> commit 542eeba [0].  IIUC it literally means that we need special handling
> for that date because POSTGRES_EPOCH_JDATE is 2000-01-01.

Yeah, I think so, and I think we probably don't need any special care
if we switch to direct tests of overflow-aware primitives.  (Though
it'd be worth checking that '1999-12-31 24:00:00'::timestamp still
works.  It doesn't look like I actually added a test case for that.)

            regards, tom lane



pgsql-hackers by date:

Previous
From: Nathan Bossart
Date:
Subject: Re: Remove dependence on integer wrapping
Next
From: Bertrand Drouvot
Date:
Subject: Track the amount of time waiting due to cost_delay