Re: Fix for edge case in date_bin() function - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Fix for edge case in date_bin() function
Date
Msg-id 2425370.1709147204@sss.pgh.pa.us
Whole thread Raw
In response to Re: Fix for edge case in date_bin() function  (Moaaz Assali <ma5679@nyu.edu>)
Responses Re: Fix for edge case in date_bin() function
List pgsql-hackers
Moaaz Assali <ma5679@nyu.edu> writes:
> - I have used INT64 -> UINT64 mapping in order to ensure no integer
> overflows are possible.

I don't think I trust this idea, and in any case it doesn't remove
all the overflow hazards: the reduction of the stride interval to
microseconds can overflow, and the final subtraction of the stride
can too.  I changed it to just do the straightforward thing
(throwing error if the pg_xxx_s64_overflow routines detect error),
and pushed it.  Thanks for the report and patch!

            regards, tom lane



pgsql-hackers by date:

Previous
From: "David E. Wheeler"
Date:
Subject: Re: An improved README experience for PostgreSQL
Next
From: Daniel Gustafsson
Date:
Subject: Re: An improved README experience for PostgreSQL