Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uT1iz-00GM36-8D for pgsql-docs@arkaria.postgresql.org; Sat, 21 Jun 2025 17:09:53 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1uT1ix-008GO9-Bp for pgsql-docs@arkaria.postgresql.org; Sat, 21 Jun 2025 17:09:52 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uT1ix-008GO1-3Y for pgsql-docs@lists.postgresql.org; Sat, 21 Jun 2025 17:09:51 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1uT1iv-003GFQ-2r for pgsql-docs@lists.postgresql.org; Sat, 21 Jun 2025 17:09:50 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 55LH9mdI2732039; Sat, 21 Jun 2025 13:09:48 -0400 From: Tom Lane To: Dean Rasheed cc: Robert Treat , Ben Peachey Higdon , pgsql-docs@lists.postgresql.org Subject: Re: Document if width_bucket's low and high are inclusive/exclusive In-reply-to: References: <2BD74F86-5B89-4AC1-8F13-23CED3546AC1@gmail.com> <1167135.1750277532@sss.pgh.pa.us> <1391433.1750345913@sss.pgh.pa.us> <2525554.1750454361@sss.pgh.pa.us> Comments: In-reply-to Dean Rasheed message dated "Sat, 21 Jun 2025 09:01:32 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2732037.1750525788.1@sss.pgh.pa.us> Date: Sat, 21 Jun 2025 13:09:48 -0400 Message-ID: <2732038.1750525788@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Dean Rasheed writes: > On Fri, 20 Jun 2025 at 22:19, Tom Lane wrote: >> So concretely, how about the attached? > LGTM (though I'm not sure it really needs the word "therefore" in the > first hunk). OK, done that way. > There are also a couple of code comments that need fixing -- Good points, also done. While looking at those comments, I also noted that there is a strange inconsistency between width_bucket_array and width_bucket_float8/width_bucket_numeric. Namely, the latter two reject an "operand" that is NaN, while width_bucket_array goes out of its way to accept it and treat it in our usual fashion as sorting higher than all non-NaNs. Clearly these functions must reject NaN histogram bounds, for the same reason they reject infinite bounds. But I don't see any reason why they couldn't treat a NaN operand as valid. Should we change them? (I imagine this'd be a HEAD-only change, and probably v19 material at this point.) regards, tom lane