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 1vDogi-00Gtbs-8F for pgsql-hackers@arkaria.postgresql.org; Tue, 28 Oct 2025 18:44:55 +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 1vDogh-00EarT-3g for pgsql-hackers@arkaria.postgresql.org; Tue, 28 Oct 2025 18:44:54 +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 1vDogg-00EarL-QH for pgsql-hackers@lists.postgresql.org; Tue, 28 Oct 2025 18:44:53 +0000 Received: from mail-lf1-x133.google.com ([2a00:1450:4864:20::133]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vDogd-004kL8-0U for pgsql-hackers@postgresql.org; Tue, 28 Oct 2025 18:44:53 +0000 Received: by mail-lf1-x133.google.com with SMTP id 2adb3069b0e04-591eb980286so6667471e87.2 for ; Tue, 28 Oct 2025 11:44:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1761677090; x=1762281890; darn=postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=U1dwTiY/sCiQ0XffOEtYRjHIvNZy36OJpEN32Hp+FzI=; b=no3MwApb2AN2Y5zZXp3k/+zNzmDRd1tMZkB0ckat00idFDu34f03RiHLrFBDuQpfPa 39vkTiqPQc4AfjUb9uB9ZiuM+gwkIvMTSg7+4PDEctG2U+jKRR5EDOvhZlWh2BMNKKda AZfYmFVComYmjLIGZjqD6esQayb7mv5nnrDe4ulXUYLHfQMCsn9UdP7YaP2DPnn5YSL8 1ZhSXeGOji6HVsxrkwWP1Wl0nvaW7wSP4pLWXWBZ9XO2EULFNjI/11qpxAco8INOyhS2 rv6NpVyHA9HcH3So+UBBVYTBEEPvhCHSWWfZSVdTznEwhCVQLVRiuoZ1Ysp/JJEEriiG kb6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761677090; x=1762281890; h=content-transfer-encoding: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=U1dwTiY/sCiQ0XffOEtYRjHIvNZy36OJpEN32Hp+FzI=; b=ucIoYassQWa+7QuGkeMQ6XRnj2XOACAkL3TpynA9sysri8Q/bP8FpRHAR7jzDofRDS YyplROB3qdfDvh5zpuKLBp9wkod/C/Ub+r1fRdxal8YvbE1EY1fGH1iS47M4iLzabnq9 uRgOVQEFCUBClRn8jNq0Y7ipPm1tEbWSyv/Kszb1JCDAMC+fPcSwkXXlU/EF8CIqSDIs Lyx7dMhnmwpqC3i9rH3WmUwj+b9X+IOvNbReWMyu2NcisiwipfUACSJagU9Ny/mVLBEN xo0uW0uN3C+ufkLlpSXgR+g8ZjsuETkvpn5rdZ1NYbR0GzC+1RmyJ5xM0bNwllnUt2vp 3gcw== X-Forwarded-Encrypted: i=1; AJvYcCXrOFv7gmIzZ4zarL/LZoMJOtQz9r2f7FTqyamDFGHk6VmHOawVQcpuaCNce1G3vZ7kkdpkXSnTdR4SzC1e@postgresql.org X-Gm-Message-State: AOJu0YyE6OZluckMcVOViPPz4dSj9HVKBPykvhWfI1LSvB7x1Ni86O0s 8IlzT4O2iH+jouujmOHOLlx0Z1GrpAKdoz46ztIWxPpKyUXx0114m5njPyQHJwBcPT8CWgr92Ja 028fwXxzxQJrsAcfyRaTS/0HvmFCfpwM= X-Gm-Gg: ASbGncvDHV8jp5jExKxb5MemIyaZIyUBV5O3AVj15bP1FuuYVGVk0vgXd8krxREipq0 PkSoMugkF9KP2jge+oykWapq0SkyyHM6jlQqm6Qi1BrMV7Nc5eS/z4jG94qGs0xFRsmoXbGbvbd NfddCkNyaVZSOTOqe/NaNmJ6mTclVyK6256DkO6iDfw1NVX81sBYGTg4Ir+NIY0dFIP2uzxqAxH KlxA2+cAp6i07PbdqIATFgR7BRWkK+c9+vgiRelOVIegGvzVrpNlAIRcoX6Ks9knyUMMU0= X-Google-Smtp-Source: AGHT+IGcrRiuTKqHfP7WrBYJKOlGwMbD428wCc7+VQCdPukBoz+xH5kccYSJfXNhM8INrfGQVcpiQqTAT45u8uf/+gA= X-Received: by 2002:a05:6512:b11:b0:591:ec0d:3014 with SMTP id 2adb3069b0e04-594128d639dmr112838e87.48.1761677089388; Tue, 28 Oct 2025 11:44:49 -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> <1895971769.8343.1761240853939@mail.yahoo.com> <574624399.175025.1761290201491@mail.yahoo.com> <953203149.383019.1761345585325@mail.yahoo.com> <6F76FA61-E2DC-44EF-9504-889D9BDB4EBD@yandex-team.ru> <1154454839.957923.1761604611424@mail.yahoo.com> <87ldkv8cog.fsf@wibble.ilmari.org> <87ikfz7zcu.fsf@wibble.ilmari.org> In-Reply-To: <87ikfz7zcu.fsf@wibble.ilmari.org> From: Masahiko Sawada Date: Tue, 28 Oct 2025 11:44:12 -0700 X-Gm-Features: AWmQ_bmDYMSOzl7-GVH-ZWTZPIf7ErBrxlkQOasS3ZxGmWQ0UBT1xk__UQ3CPlY Message-ID: Subject: Re: Add uuid_to_base32hex() and base32hex_to_uuid() built-in functions To: =?UTF-8?Q?Dagfinn_Ilmari_Manns=C3=A5ker?= Cc: Jelte Fennema-Nio , Sergey Prokhorenko , Andrey Borodin , pgsql-hackers Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, Oct 28, 2025 at 9:41=E2=80=AFAM Dagfinn Ilmari Manns=C3=A5ker wrote: > > Dagfinn Ilmari Manns=C3=A5ker writes: > > > Jelte Fennema-Nio writes: > > > >> Then combining that with UUID <-> bytea casting (which also > >> seems totally reasonable functionality to me), would give you the > >> functionality (but not the defaults you want). > > > > +1 for adding casts. > > Here's a patch for that. I'm not 100% confident about the error code > for invalid length, but that was the closest one I could find in > errcodes.txt. Thank you for the patch. I'll review it. > I might do the base32hex encode/decode later, unless someone else beats > me to it. Andrey has shared his patch for base32hex support before[1]. While it needs to be updated, it seems to implement sufficient function. Regards, [1] https://www.postgresql.org/message-id/6F76FA61-E2DC-44EF-9504-889D9BDB4= EBD%40yandex-team.ru --=20 Masahiko Sawada Amazon Web Services: https://aws.amazon.com