Re: Document if width_bucket's low and high are inclusive/exclusive - Mailing list pgsql-docs

From Dean Rasheed
Subject Re: Document if width_bucket's low and high are inclusive/exclusive
Date
Msg-id CAEZATCUnTYEi5QEFtRkaNvMYHfanKbwJir1E9Q8qYzaLt_0ktQ@mail.gmail.com
Whole thread Raw
In response to Document if width_bucket's low and high are inclusive/exclusive  (Ben Peachey Higdon <bpeacheyhigdon@gmail.com>)
Responses Re: Document if width_bucket's low and high are inclusive/exclusive
List pgsql-docs
On Fri, 20 Jun 2025 at 22:19, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
> So concretely, how about the attached?
>

LGTM (though I'm not sure it really needs the word "therefore" in the
first hunk).

There are also a couple of code comments that need fixing --
width_bucket_float8() comes with the following comment:

 * 'bound1' and 'bound2' are the lower and upper bounds of the
 * histogram's range, respectively. 'count' is the number of buckets
 * in the histogram. width_bucket() returns an integer indicating the
 * bucket number that 'operand' belongs to in an equiwidth histogram
 * with the specified characteristics. An operand smaller than the
 * lower bound is assigned to bucket 0. An operand greater than the
 * upper bound is assigned to an additional bucket (with number
 * count+1). We don't allow "NaN" for any of the float8 inputs, and we
 * don't allow either of the histogram bounds to be +/- infinity.

so at the very least, that should be made to say "greater than or
equal to", instead of "greater than". Similarly for
width_bucket_numeric().

Also, since PG14, type numeric has supported infinity, so its comment
should probably include that last part about not allowing +/- infinity
in the histogram bounds.

Regards,
Dean



pgsql-docs by date:

Previous
From: Masahiko Sawada
Date:
Subject: Re: Fix incorrect UUID index entry in function documentation
Next
From: Tom Lane
Date:
Subject: Re: Document if width_bucket's low and high are inclusive/exclusive