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 1vBw1H-00722k-0t for pgsql-hackers@arkaria.postgresql.org; Thu, 23 Oct 2025 14:10:22 +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 1vBw1F-0092y6-9l for pgsql-hackers@arkaria.postgresql.org; Thu, 23 Oct 2025 14:10:20 +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.94.2) (envelope-from ) id 1vBw1E-0092xb-Vr for pgsql-hackers@lists.postgresql.org; Thu, 23 Oct 2025 14:10:20 +0000 Received: from mail-lj1-x236.google.com ([2a00:1450:4864:20::236]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vBw1A-003odE-2o for pgsql-hackers@postgresql.org; Thu, 23 Oct 2025 14:10:19 +0000 Received: by mail-lj1-x236.google.com with SMTP id 38308e7fff4ca-378d50e1c77so8120841fa.0 for ; Thu, 23 Oct 2025 07:10:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jeltef.nl; s=google; t=1761228616; x=1761833416; darn=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=lDQDNU1uQcRRjkf9ZBogmYiUXRiABhjPuc0O2ZTP0Y8=; b=VZXIuEfh2g/B8PppJ5OFqhBln/93ZorXz5yWBMWxMHyATJT8AFcAmWKPpbZPRGXbfi 36cQ1urmEqgsu1v2nr20FbI+oJTlFEnfMtRQ1VEA8yMCD22TCZnt/5dF0OYEZW7v1Irk 6IthS8TdrGZJyeGSSwp5m13nHKEbGXYwqsLpivFeVMKuC3wa+GyW437sa+BtITAPc4LG S+Mw6dOj92Z3aF4wOOIXlFoPWUdskoGPhimrxA2rqbljWL98XQWf2u0OGHizx+W7VU2N 1EeruPx+/4VYf62zZ549gmvs2ybYOxLOkJZiROMTPAaUy867oShPj1bsNaYLG3tA7kxO OEYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761228616; x=1761833416; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=lDQDNU1uQcRRjkf9ZBogmYiUXRiABhjPuc0O2ZTP0Y8=; b=lUpoIhYFvtYf66/oe8Ngy0QnaZWkafUDpjkRjgDfo46PrYUqEooAKcQpDhwIQ6IT1e P2ipeEIOZIN/63LlIuxM3b8EbkEdIefBguQ/DyeOAPhQJSRHgqk7/BqoVaBdA9Jda9aa 8FRKPVF2z+/DMp/DawYXOVVqsT0BIPHmIQn3TEY+rKRx8O1c5Wjx7AR+w26venMtP3FR wpGHDLNwszSCPGYVToeD27ZyXnJSoTrm3Pdler/RkU/j4joxMzTmuXE+WlvBNmak6Ktn IvdKnOvxiMOXa4v5MhnQxFgTCbPSikOJXs5BRMIbKpwGWTtb0TWOX3xhVpO74r/NJdkk HYMw== X-Forwarded-Encrypted: i=1; AJvYcCWhKDKKG2369c+D+ZCYudICC2x83r48NthwLIo7m12gdj7UVEsdR9FpASyrnIvAPMquM200fHjgk/naVKR6@postgresql.org X-Gm-Message-State: AOJu0YzeLN2kCC2f8vmD3dOj1xTBlYJloIMsvExv8W9J12n+r86X4Oai iHNIe4/Gw3MqcsGZYurMuVO0eT0MOsGdXz3aLpVGBhpVPx+7pLLg9nAu0kwV9DpjYbyfe4C2+zJ ixPJ8tbRW3jQJ9mc7nAxnL7U9CwevSTU9i5nAbuztDA== X-Gm-Gg: ASbGncuFld6VJo3F7XMDgdSnfIlVe2uk1ODn8QgKQfhODkax2Vh2m+9RvtXBuxegJlT t8Y5UtedrSFW1R9avmTpLD8irnrMK3+xPZAMZMFzRZDkyU8e6Bvj0lSh4e7+LiNpBF8or5RVSe5 zF20WyeiWiRPYeQNKP3OxSivtuztArobG1lW0CuIK6uwJxrKobbwo1pM4zed8XgMsFy6BUzMl9n aPJhq4AuPR3olUBo6kUwGit6bpQpZfF1RJyb6KlxV0Yc4gXhhTbgwZpmbXoK2pjhSj6tg== X-Google-Smtp-Source: AGHT+IGo8W0KmxIH4CAMgeo1UayvJozHmllTXxBPfeHVIU81ZQfxLAgrlsSFn2Bsa0UJzxvwoBKFntpkDVGy0iVhSrU= X-Received: by 2002:a05:651c:4390:10b0:377:c078:dfb2 with SMTP id 38308e7fff4ca-377c078e3femr36368311fa.17.1761228615201; Thu, 23 Oct 2025 07:10:15 -0700 (PDT) MIME-Version: 1.0 References: <1791665551.452444.1761209220211.ref@mail.yahoo.com> <1791665551.452444.1761209220211@mail.yahoo.com> <18022523-0F8F-4C07-AFF5-57DC9086D78E@yandex-team.ru> In-Reply-To: <18022523-0F8F-4C07-AFF5-57DC9086D78E@yandex-team.ru> From: Jelte Fennema-Nio Date: Thu, 23 Oct 2025 16:10:04 +0200 X-Gm-Features: AS18NWDT4DeeXlHfawhOI5jl-9VUbi1OWSgMqzfxVRPu10q6dUwqsMD88Nux6kw Message-ID: Subject: Re: Add uuid_to_base32hex() and base32hex_to_uuid() built-in functions To: Andrey Borodin Cc: Aleksander Alekseev , pgsql-hackers , Sergey Prokhorenko Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, 23 Oct 2025 at 15:07, Andrey Borodin wrote: > > SELECT encode(uuidv7() :: bytea, 'base32'); > > That's an excellent feedback! Would such conversion be idiomatic for Postgres users? > Are there any other alternative approaches? Agreed that extending the encode function is the way to go. An example of that is the recently added support for base64url: https://git.postgresql.org/cgit/postgresql.git/commit/?h=REL_18_0&id=e1d917182c1953b16b32a39ed2fe38e3d0823047 > > The value of converting uuid to base32 is not obvious though, so I > > would recommend explaining it in more detail. > > Yes, and maybe some examples of other systems that adopted this format would be handy too. Sergey, can you, please, extend reasoning why this particular format is prominent? RFC 4648 describes a bunch of formats. I've definitely used base32 to encode uuids myself. The primary benefit being shorter strings, while still being able to spell them out by voice to people without having to specify whether a letter is upper or lowercase.