On Thu, 23 Oct 2025 at 15:07, Andrey Borodin <x4mmm@yandex-team.ru> 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,
extendreasoning 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.