Bertrand Drouvot <[email protected]> writes:
> On Wed, Mar 11, 2026 at 11:19:45AM -0400, Tom Lane wrote:
>> The defenses in those modules are probably obsolete too: aren't they about
>> ensuring exact results with floating-point timestamps?  My gut reaction to
>> this was maybe we could remove *all* of that, so now I'm curious what
>> problem Bertrand ran into.

> I got some regression tests failing: [1].

Yeah.  I quickly tried it here (ie remove the defenses and build with
-ffast-math), and observed failures in a couple dozen core regression
tests.  A bit of study suggests that

(1) both isnan() and isinf() tests are broken and always return false,
at least in some call sites;

(2) the code now seems exceedingly cavalier about near-overflow cases,
such as

regression=# select 1.175494e-38::float4;
ERROR:  "0.00000000000000000000000000000000000001175494" is out of range for 
type real

which is a case that works fine normally.

So no, I don't wanna support this.  But maybe we should move the
code-level tests out of the datetime files and into utils/float.h
or some such place.

                        regards, tom lane


Reply via email to