Re: Allow the "operand" input of width_bucket() to be NaN

From: Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Allow the "operand" input of width_bucket() to be NaN
Date: 2025-07-02 06:48:31
Message-ID: CAEZATCWqd=QeLDovvHQ7+Rpe5yMgsusQhXptg+tOikJD3opU9Q@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, 21 Jun 2025 at 22:21, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
> The attached patch does what was discussed in the pgsql-docs
> thread at [1], namely change the four-argument variants of
> width_bucket() to allow their first argument to be NaN,
> treating that value as larger than any non-NaN.
>

LGTM.

I note that there is no doc update, and I think that is correct, since
we never previously documented that NaN wasn't allowed. The new
behaviour is what one would have expected, given that we do document
that NaN values compare as greater than all non-NaN values.

It could even be argued that this is a bug fix, but the lack of prior
complaints justifies not back-patching.

Regards,
Dean

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message John Naylor 2025-07-02 07:01:13 cpluspluscheck vs ICU again
Previous Message vignesh C 2025-07-02 06:42:17 Invalid pointer access in logical decoding after error