Re: Wrong results from in_range() tests with infinite offset

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Cc: Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>
Subject: Re: Wrong results from in_range() tests with infinite offset
Date: 2020-07-16 21:50:16
Message-ID: 3464257.1594936216@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I wrote:
> When the current row's value is +infinity, actual computation of
> base - offset would yield NaN, making it a bit unclear whether
> we should consider -infinity to be in-range. It seems to me that
> we should, as that gives more natural-looking results in the test
> cases, so that's how the patch does it.

Actually, after staring at those results awhile longer, I decided
they were wrong. The results shown here seem actually sane ---
for instance, -Infinity shouldn't "infinitely precede" itself,
I think. (Maybe if you got solipsistic enough you could argue
that that is valid, but it seems pretty bogus.)

regards, tom lane

Attachment Content-Type Size
fix-infinite-in_range-cases-2.patch text/x-diff 8.5 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David G. Johnston 2020-07-16 21:55:54 Improve Managing Databases Overview Doc Page
Previous Message Christoph Berg 2020-07-16 19:46:03 Re: Encoding of src/timezone/tznames/Europe.txt