public inbox for [email protected]  
help / color / mirror / Atom feed
From: Jelte Fennema-Nio <[email protected]>
To: Andrey Borodin <[email protected]>
Cc: Aleksander Alekseev <[email protected]>
Cc: pgsql-hackers <[email protected]>
Cc: Sergey Prokhorenko <[email protected]>
Subject: Re: Add uuid_to_base32hex() and base32hex_to_uuid() built-in functions
Date: Thu, 23 Oct 2025 16:10:04 +0200
Message-ID: <CAGECzQRNgpxZswyN98UvV+gLCpqOxEUXvaq0TPTtn8qVfJ+7vQ@mail.gmail.com> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
	<[email protected]>
	<CAJ7c6TOramr1UTLcyB128LWMqita1Y7=arq3KHaU=qikf5yKOQ@mail.gmail.com>
	<[email protected]>

On Thu, 23 Oct 2025 at 15:07, Andrey Borodin <[email protected]> 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=e1d917182c1953b16b32a39ed2f...

> > 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.





view thread (62+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected]
  Subject: Re: Add uuid_to_base32hex() and base32hex_to_uuid() built-in functions
  In-Reply-To: <CAGECzQRNgpxZswyN98UvV+gLCpqOxEUXvaq0TPTtn8qVfJ+7vQ@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox