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.96) (envelope-from ) id 1wD21o-002XOf-1I for pgsql-bugs@arkaria.postgresql.org; Wed, 15 Apr 2026 15:19:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wD21m-000Psw-1b for pgsql-bugs@arkaria.postgresql.org; Wed, 15 Apr 2026 15:19:42 +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.96) (envelope-from ) id 1wD21m-000PsY-0B for pgsql-bugs@lists.postgresql.org; Wed, 15 Apr 2026 15:19:42 +0000 Received: from mail-yx1-xb134.google.com ([2607:f8b0:4864:20::b134]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wD21k-00000001AMq-09bb for pgsql-bugs@lists.postgresql.org; Wed, 15 Apr 2026 15:19:41 +0000 Received: by mail-yx1-xb134.google.com with SMTP id 956f58d0204a3-651bf695701so1967073d50.2 for ; Wed, 15 Apr 2026 08:19:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1776266379; cv=none; d=google.com; s=arc-20240605; b=Ft3gP3Rv4RRgkK7gsVrStRm24uS3IsCE5vPF0q5GJ45SD4WRwLVbCFfV9im9MuHJsP Bd8PM2wDfIbdrokEJe6T4KIS2jKESNbw/qRnQbEXiioYBwIEQR1ZdsKXu9zs6Ju27NoU nnsY9U62/pLid8oDvQ5lIyXiIh5w+GCjqDp266KPF4EF7DrSiTriv9Ip3zlWV/TSQMUW 49JVbgT2JxlDIyW9JmNP0dig9sDsvWTQAGaZcX77Jt/zTtmqZZLs7vRwlT3CcKJtMoM3 BD82zz8ITDdV0dHhL3xjRByOvi+nphnQqztAU2vWoCEQmjNooYjy9XWMJtOHNATzw7oB G40Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=upI8UXEKm0s4dVuP2OBF5OwYrtlN+/pte7H0Wsu+klA=; fh=oG+QixNHQNjbvP4IgwxfovMKN4S0556pzlsASoxeGu4=; b=hZoQN1GyCO/tQWhkWLtbxhRjflOOSGEmmCH7cA2JZSdSejj4CgfKMvr9TH0Udq0xY+ PBYpU1SNVsVwUJ75T8EHtRFsAN4kX7px6WMsEUj3Adoc0Xlhr0w6oBQV1nQ0aOYewajN OhfHSeljwFu4rEHOY5ja7XRrN2lksWcjOIxzq3x8wVQ/J2M7qVtQq5od7poJcSwkCT1o INmNanwjdaPSpsaJSPves4BCwZ8jhunnZ6uBBpr7KHKf0tyKGISbx5rGIt4PTktNXqjC 8bMGbgWPxjOCJpXOZGIEcXHUL2oQAet7sB4afmwV8q1mvI714QmfWInAzlE/tlHEaF9a g9BA==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1776266379; x=1776871179; darn=lists.postgresql.org; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=upI8UXEKm0s4dVuP2OBF5OwYrtlN+/pte7H0Wsu+klA=; b=s+9XNG7kMZwLfAegQmQQ5hbrwNsur2I64Nf6toYFqiJf8fBD8Pg+2v3vTC+cpySSn6 SELr6VPp3bwLudblBXZ4urA2pKfJCf5cACEvEYzFniMwTtoc18eWNxBgAEYnMFnZ095N LWRqiJDIHdyiDR+DgXrZQeyn+qpPCrBTZfBib6N8PHSqKjGZvBXHgqO+rMaVIIpjX6ad ijFNoBW5+aJOA7wrxMosNIZJxs7WpBEWohQHGKzwnmrWCWCdGhAOopyKQR0XQVpGjKO2 KmsvGFVBlXcj8Hp6UG6dVYi84PhwOAIqwljqeKlSH4sbIkGpxMKhafNz0C8F4f1YTQ0F euyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776266379; x=1776871179; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=upI8UXEKm0s4dVuP2OBF5OwYrtlN+/pte7H0Wsu+klA=; b=N+pdkvzgt32dJEhwP1DGNa0iRX4SFhDWIwBe435Hfl9J0gwgE+sKpMZl9mDePowbVz 0ZsqIqylzEbpS2Yd09hhGISVLxc1vOIqiDukxTYF2JD0245H81IQNZgdjjhvIy2ugRLz 5ANkkLzc/zSxrdPVIFR6hyLxsQ1vxonCBXA3mk15+zooFTDslqKjirh9xJorlTKoEGFv 5hXq9wDWJFJf3dUzD26Y5bni5ZqhDd9n4NVm6xTERfZuuJkg9JPUDXUCjLk/XxJ/ldYZ NWN3dNMDdtj6lOt7a1ERSXOfIpJu0Kv4LamJjdZPFxtr/vuyo+lE1TEJ9WXgvJdr/VhG 6WXg== X-Forwarded-Encrypted: i=1; AFNElJ/5vg//OKIiUzZRMxYSYL1f1GSUrM/NcXlb3wTT8mQ/T+mnVEh4GIeVwfP2WIFBp6bW7Amavn1+3L+3@lists.postgresql.org X-Gm-Message-State: AOJu0Yxt0S4Fq3GnbjFahQKNoIjywXmLKzGjguoVWfvXnzxk+5YmNEwc vc7BBqstAb6op87gVG9U5LqA3BmjjzxeH3zbLBZ4zJr2piaHQHZZsMlEExj0sMG+FwygVjW4p// OQ3b2JpxGWYgY6KyVFALZRR8x9FjK7YK6pAwr X-Gm-Gg: AeBDieuly4/5QSiWkUf3K6IRLAIpDQz5WSQ9vHMkld4+Cr5APf8bvFvRnVILWBl9c2t gVQ/gPKmb8n4QE1sIGbfXEsHjRqN8zEMkdD76H56/dxJiw/vK3NO3aUXqlcnrP1X+EKfSnFcNzj Wc7xuj2PfwcJH8tiuj2itHU1+vbD2OTuPiDn3UPAMJT4+bohv2vRkdsKxzYwwuBo8TniyvHZK6+ VlN8/hLMf2oI+0aBmx0n6C1Y3RnCwqRdGv07qPyGp6L7PvX/7VAGVNox5ua/AMz5zAIkOdkJQCq LVo1toRmf1AC3Ik8Dg== X-Received: by 2002:a53:c4c1:0:b0:650:379f:3580 with SMTP id 956f58d0204a3-65198a8847bmr16001770d50.21.1776266379368; Wed, 15 Apr 2026 08:19:39 -0700 (PDT) MIME-Version: 1.0 References: <19456-b16ffd2798ae6fd5@postgresql.org> In-Reply-To: <19456-b16ffd2798ae6fd5@postgresql.org> From: "David G. Johnston" Date: Wed, 15 Apr 2026 08:19:02 -0700 X-Gm-Features: AQROBzA42dzb0XxPYJZLJltsIc69Wyclc_pKpidrcSpu2iYxQDvBOKnCy0vXPuo Message-ID: Subject: Re: BUG #19456: # Unit-Labeling Issue: `pg_size_pretty()` Incorrectly Labels Binary Units as Decimal Units To: gautamkumar2764@gmail.com, pgsql-bugs@lists.postgresql.org Content-Type: multipart/alternative; boundary="000000000000919e06064f813e9b" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000919e06064f813e9b Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Apr 15, 2026 at 7:48=E2=80=AFAM PG Bug reporting form < noreply@postgresql.org> wrote: > The following bug has been logged on the website: > > Bug reference: 19456 > Logged by: GAUTAM KUMAR > Email address: gautamkumar2764@gmail.com > PostgreSQL version: 16.8 > Operating system: LINUX > Description: > > The function appears to calculate sizes using binary (base-2) division > You don't need to infer this, you can just read the documentation. "Converts a size in bytes into a more easily human-readable format with size units (bytes, kB, MB, GB, TB, or PB as appropriate). Note that the units are powers of 2 rather than powers of 10, so 1kB is 1024 bytes, 1MB is 10242 =3D 1048576 bytes, and so on." https://www.postgresql.org/docs/current/functions-admin.html#FUNCTIONS-ADMI= N-DBOBJECT Which means it is not a bug. And it's not the kind of behavior we are going to change on people. Maybe go write and submit a pg_size_iso(byte_count [, basis 2|10 default 10]) function. I agree this is a gap that could be addressed. I'd probably drop the pg_ prefix as well - that always just seemed odd to me. We have plenty of functions that are non-standard that we don't prefix like this. David J. --000000000000919e06064f813e9b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Wed, Apr 15, 2026 at 7:48=E2=80=AFAM PG Bug reporting f= orm <noreply@postgresql.org> wrote:
The following bug ha= s been logged on the website:

Bug reference:=C2=A0 =C2=A0 =C2=A0 19456
Logged by:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 GAUTAM KUMAR
Email address:=C2=A0 =C2=A0 =C2=A0
gautamkumar2764@gmail.com
PostgreSQL version: 16.8
Operating system:=C2=A0 =C2=A0LINUX
Description:=C2=A0 =C2=A0 =C2=A0 =C2=A0

The function appears to calculate sizes using binary (base-2) division
<= /blockquote>

You don't need to infer this, you can jus= t read the documentation.

"Converts a size in byt= es into a more easily human-readable format with size units (bytes, kB, MB,= GB, TB, or PB as appropriate). Note that the units are powers of 2 rather = than powers of 10, so 1kB is 1024 bytes, 1MB is 10242 =3D 1048576 bytes, an= d so on."

https://www.post= gresql.org/docs/current/functions-admin.html#FUNCTIONS-ADMIN-DBOBJECT

Which means it is not a bug.=C2=A0 And it's not the= kind of behavior we are going to change on people.

Ma= ybe go write and submit a pg_size_iso(byte_count [, basis 2|10 default 10])= function.=C2=A0 I agree this is a gap that could be addressed.
I'd probably drop the pg_ prefix as well - that always just s= eemed odd to me.=C2=A0 We have plenty of functions that are non-standard th= at we don't prefix like this.

David J.
= =C2=A0

--000000000000919e06064f813e9b--