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 1wCflf-002DAp-0c for pgsql-hackers@arkaria.postgresql.org; Tue, 14 Apr 2026 15:33:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wCfld-00CZYg-0y for pgsql-hackers@arkaria.postgresql.org; Tue, 14 Apr 2026 15:33:34 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wCflc-00CZYX-3A for pgsql-hackers@lists.postgresql.org; Tue, 14 Apr 2026 15:33:33 +0000 Received: from mail-ej1-x62e.google.com ([2a00:1450:4864:20::62e]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wCflb-000000012r8-2mYI for pgsql-hackers@lists.postgresql.org; Tue, 14 Apr 2026 15:33:33 +0000 Received: by mail-ej1-x62e.google.com with SMTP id a640c23a62f3a-b9358dd7f79so922122166b.1 for ; Tue, 14 Apr 2026 08:33:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1776180805; cv=none; d=google.com; s=arc-20240605; b=NzWlEZaL0MmPb9VpRWFmB643sg5jUNkutshhBPVIJlMfyq2EldQ9pjaq6wrL/5ZfdA 22Ink4YWOMrsUOeM3aOgX5UYZgX5iQTFnIpxr4PDdBkWEkYpD1rVGriEL4pm8VvH6wUI ogCGAMndhLPqjc8UceN3cIVn1QTf+Po3QJjBDCA6zyprO37tQpwC843nMPF+8+qCF8wc XNxVl0CWb0J6rJPgyHwS0248lfXeULL3rKwFk/qF8XYPJp9w+Meh7dO6Ogp48uUdn1xp g011almQAv2ZdPx8v3EwmNlL8DyuAJVoz40ZdLGBzaSuNVnq1f/oiHPatmV0gg38Wy3D uhHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=whpM+Z4uPW7oDNGXH5vUb0rSbNdLk8QlNIAdYb1yHk0=; fh=Ar/7L9MQAonyVk7yJXMOhs+KXA0+dtKqQ8DNl9SCXF8=; b=eZzQCT8jC0vU2wiOoXv+PqEhIbKcEIHMet6Dl0cSuWoyu1lJhzIvrHSDk8O+FTgN9S m12VJWYwp/mL0MPHurC84ZbjysXYvRnI60iqa4X2k49Un+UvdEKKYhpZft40qZJM/CyE rj+UFpLjOLJSdhcJgxEepXkuFebYzVGAqmTVXOiDk0fjW+O8ooAlWGW2JYuQR9UnKC8W A4LaYSKnW4cQ/6PzNLcmPHWswbNPsh/7Qn02tVtfHQdmbirWmpRTDx647ucyRAfwzjkU LQaKzd+aRtGkcAo+f2nMYYAUnzriOJoPh50DQhQcNYEapu5QnVFpEwnzrPx40E5Io1+k 24bA==; 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=1776180805; x=1776785605; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=whpM+Z4uPW7oDNGXH5vUb0rSbNdLk8QlNIAdYb1yHk0=; b=IMaf8SV2U8m9VLD2wP33qIWIQTfg+st6LQ5xgnSyJ+tGxY6z3DMG02sjJv4Q7ZCm6O pqvooFsNSjl/Pzg6LPgvkkSfQidzTJDW1q6PsGmxcFrnYlZuc5WFbEfzuyz6XSjl/Ad7 LKjqpECGwy4eMoBV5j1/d+sBfpVbitccvbOr3CfMboLxwDjs4MDU2epLArU2s9EbtotS K0CY8kd6VYuTwmLd2DL4VTLVDws0gSGRlZnN+caNnCpGANK8S+tFzDy8XMpGHGJ5nMqH ruJKtWmV/Xe6cn81n/hUFUdtdv6gj6Hth58cbRNIhYdgPXk9kJ3adq0fs1SQcjWEcuHf GJuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776180805; x=1776785605; h=cc: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=whpM+Z4uPW7oDNGXH5vUb0rSbNdLk8QlNIAdYb1yHk0=; b=XAmKCM16GyFCC0gZYhdICXVURHjZpsXmsd34slqqlm6PoZzezjPaPt1GgThcuY/0zj cCmQMLyLXF9zWkGRNXumCEuSesNLcpnZ1nSBfvV9pMdw4BlhMsHU8hUSoU7aFWQ5JogP Snw9DdFH6EG6Pew8KNH/b0/CKK5Bxc2G2Pb3cn9Zm+o0KS/aD/Fe/M2ZK0LLcY7dBxA5 8r/R1QyFgprSr2r/ZdFSrnSUbh/CtB0w8y0KUPcMHzcrWY1VKMUbclerfkwYgi/5m/2j D7Owysd/npnAy48TPRO2pAwfVpbCt7O3IOWTDBVEcPMkK+5Y7MyInxXM2j9nXtPzelp6 Dh1w== X-Gm-Message-State: AOJu0Yxny2giMTx+p9MDklEfiY1noRTFeY/hmTRwGGvBjaf4c3R06KN1 4fUpWIaAwcNjJDBBUf+BIq0zyOKqRFXD7VGaC5LEk8AJDXT40DhFq6towdLl6rMcRxFL/KjAsHH oVJ99MDEUjfxFkQcdHjUUt2TkN/pZisM= X-Gm-Gg: AeBDiesv5LZ7M9lRXQbNmgOOztM2Vfy3Clk/ijKTgxmdfh5z4u3L2fqmCe48W48IGd8 GnKW/lLCD7xQLjEci2n7ju074Hg8mIrca8nVTwQ6zxBP3+6mdTIDTnb7Zl8p/N9neIEQ/jFP7s+ VqB9Bpmnx9RumhX9vRZlpqRjOxTbrUK3+R3XqgJjljJZKyRPPiWHSO600AX7b7+ae2Mt8VtRlUx LnVQBhgoV+OdDTu6evgIJbeIyjSIBMyuXuzQ1mt2C4N0tDBtbIjUpFa/XgPgSlg/EsfnTMhImiV Sn6wfQCmt9dfxDtxXA3qOy3G7wEDOcQ0p5zaMHfvufYo0ARFH0Bp8WpeZOzgs1T3vDoHUZVBgTs isg4uaawO7EMDXpQJXvwnWkjuAeJC5QFWlYeOZkLgcfguaTyy0XqSOxXATxJ+eZNURXU7hnt9Oy wyTBt2nazkA9uE7Mk= X-Received: by 2002:a17:907:1582:b0:b97:cc05:61a7 with SMTP id a640c23a62f3a-b9d727a1545mr693729466b.51.1776180805078; Tue, 14 Apr 2026 08:33:25 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Florents Tselai Date: Tue, 14 Apr 2026 18:32:47 +0300 X-Gm-Features: AQROBzBpp6uQuYHU_p12OQ08xYCIs1REjzMPOBMkaaqv-Y5WBGNdvi1mib3touc Message-ID: Subject: Re: ISBN range table To: Thomas Munro Cc: PostgreSQL Hackers Content-Type: multipart/mixed; boundary="000000000000f1d686064f6d51d9" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000f1d686064f6d51d9 Content-Type: multipart/alternative; boundary="000000000000f1d684064f6d51d7" --000000000000f1d684064f6d51d7 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Apr 14, 2026 at 6:05=E2=80=AFAM Thomas Munro wrote: > On Sun, Apr 12, 2026 at 11:37=E2=80=AFPM Thomas Munro > wrote: > > A recent-ish thread[1] made me wonder what that big table of data > > does, and why we have a random update every decade or so, and I came > > up with the attached. > > Fixed a couple of typos and added as commitfest #6676. The idea is > that update_isbn.py would become another periodic update task, similar > to Unicode, contrib/unaccent and the IANA timezone stuff. I suppose > running it only for major releases would be enough for such > non-critical data. There are also some other much smaller tables in > this contrib module, but they don't seem to be moving (?) so I didn't > look at them. > > I'm not volunteering today, but a passing thought I had while browsing > this complicated code full of scary pointer arithmetic is that it > might be an idea to try to describe the entire EAN3 number space in a > much simpler single binary-searchable array that maps uint64_t ranges > to TO_CHAR format strings, with entries that look something like: > > {9780037000000, 9780638999999, "999-9-99-999999-9"} > Nitpick; I'd just use standard python and avoid import requests . --000000000000f1d684064f6d51d7 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On T= ue, Apr 14, 2026 at 6:05=E2=80=AFAM Thomas Munro <thomas.munro@gmail.com> wrote:
On Sun, Apr 12, 2026 at 11:37=E2=80=AFPM Thomas Munro <thomas.munro@gmail.com= > wrote:
> A recent-ish thread[1] made me wonder what that big table of data
> does, and why we have a random update every decade or so, and I came > up with the attached.

Fixed a couple of typos and added as commitfest #6676.=C2=A0 The idea is that update_isbn.py would become another periodic update task, similar
to Unicode, contrib/unaccent and the IANA timezone stuff.=C2=A0 I suppose running it only for major releases would be enough for such
non-critical data.=C2=A0 There are also some other much smaller tables in this contrib module, but they don't seem to be moving (?) so I didn'= ;t
look at them.

I'm not volunteering today, but a passing thought I had while browsing<= br> this complicated code full of scary pointer arithmetic is that it
might be an idea to try to describe the entire EAN3 number space in a
much simpler single binary-searchable array that maps uint64_t ranges
to TO_CHAR format strings, with entries that look something like:

=C2=A0{9780037000000, 9780638999999, "999-9-99-999999-9"}

=C2=A0Nitpick; I'd just use standard pytho= n and avoid import requests .=C2=A0
--000000000000f1d684064f6d51d7-- --000000000000f1d686064f6d51d9 Content-Type: application/octet-stream; name="stdpy.diff" Content-Disposition: attachment; filename="stdpy.diff" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_mnys2vy20 ZGlmZiAtLWdpdCBhL2NvbnRyaWIvaXNuL3VwZGF0ZV9pc2JuLnB5IGIvY29udHJpYi9pc24vdXBk YXRlX2lzYm4ucHkKaW5kZXggNWI0NGI1YzE4ZmYuLjg1NmE2ODI4YzVkIDEwMDY0NAotLS0gYS9j b250cmliL2lzbi91cGRhdGVfaXNibi5weQorKysgYi9jb250cmliL2lzbi91cGRhdGVfaXNibi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