Re: Add uuid_to_base32hex() and base32hex_to_uuid() built-in functions

From: Aleksander Alekseev <aleksander(at)tigerdata(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Cc: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, Dagfinn Ilmari Mannsåker <ilmari(at)ilmari(dot)org>, Andrey Borodin <x4mmm(at)yandex-team(dot)ru>
Subject: Re: Add uuid_to_base32hex() and base32hex_to_uuid() built-in functions
Date: 2026-03-24 15:31:41
Message-ID: CAJ7c6TN7fjWDWSVmhQuNCPYLVL9cs9ifc4D_Hj6wUQd2Lw2oNQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

> > The patch looks basically good to me. I've made some changes to the
> > regression test part as I want to have round-trip tests. I've merged
> > the tests checking the sortability to the existing tests and added
> > round-trip tests. With this change, we can test round-trip tests and
> > sortability tests with random UUID value in every test run while
> > minimizing the test time. Feedback is very welcome.

v11 looks good to me.

> It looks like leading, trailing, and embedded whitespace are all ignored. But I don’t see a test case covering this behavior, so maybe it would be good to add one.

I intentionally didn't include this test because the code is trivial:

``
/* Skip whitespace */
if (c == ' ' || c == '\t' || c == '\n' || c == '\r')
continue;
```

And also because we never tested it for base64. If we want to start
testing it we should add tests both for base64 and base32hex which IMO
should be a separate patch.

--
Best regards,
Aleksander Alekseev

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ashutosh Bapat 2026-03-24 15:32:00 Re: Better shared data structure management and resizable shared data structures
Previous Message Henson Choi 2026-03-24 15:07:30 Re: SQL Property Graph Queries (SQL/PGQ)