| From: | Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com> |
|---|---|
| To: | Aleksander Alekseev <aleksander(at)tigerdata(dot)com> |
| Cc: | pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, 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 01:17:24 |
| Message-ID: | CAD21AoAj+KOc74wOr04oGo9ySYmf_TYkMi5fByLF80cqyZmB=g@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
On Fri, Mar 20, 2026 at 7:24 AM Aleksander Alekseev
<aleksander(at)tigerdata(dot)com> wrote:
>
> Hi,
>
> > > Also, a small nitpick is that we can use uint32 instead of uint64 for
> > > 'bits_buffer'. I've attached the updated patch as well as the
> > > difference from the previous version.
> >
> > Then I suggest using uint32 for the bits_buffer variable in
> > base32hex_encode() too. Also we should use 1U instead of 1ULL with
> > uint32.
>
> CI is not happy with the new test:
>
> ```
> SELECT decode('あ', 'base32hex'); -- error
> -ERROR: invalid symbol "あ" found while decoding base32hex sequence
> +ERROR: invalid symbol "ã" found while decoding base32hex sequence
> ```
>
> Although it passes locally. My best guess is that something is off
> with the database encoding on CI and that we shouldn't use this test.
> We have a similar test which uses ASCII symbols only.
Good catch. Yes, we should not use this test depending on the database
encoding and it seems we can omit this test in the first place.
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.
Regards,
--
Masahiko Sawada
Amazon Web Services: https://aws.amazon.com
| Attachment | Content-Type | Size |
|---|---|---|
| v11-0001-Add-base32hex-support-to-encode-and-decode-funct.patch | application/x-patch | 17.1 KB |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Gyan Sreejith | 2026-03-24 01:23:29 | Re: [Proposal] Adding Log File Capability to pg_createsubscriber |
| Previous Message | jian he | 2026-03-24 01:16:47 | Re: [PATCH] no table rewrite when set column type to constrained domain |