Re: Add uuid_to_base32hex() and base32hex_to_uuid() built-in functions - Mailing list pgsql-hackers

From Jelte Fennema-Nio
Subject Re: Add uuid_to_base32hex() and base32hex_to_uuid() built-in functions
Date
Msg-id CAGECzQTEK58Ef8w5xA=8KGT6D2seHF0fN0XNdgRov7Lp4bitGQ@mail.gmail.com
Whole thread Raw
In response to Re: Add uuid_to_base32hex() and base32hex_to_uuid() built-in functions  (Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>)
List pgsql-hackers
On Tue, 28 Oct 2025 at 17:41, Dagfinn Ilmari Mannsåker
<ilmari@ilmari.org> wrote:
> Here's a patch for that.

Looks good to me. Maybe add a test where not every byte is the same though.

> I'm not 100% confident about the error code
> for invalid length, but that was the closest one I could find in
> errcodes.txt.

The errorcode you chose seems acceptable to me, but I think a slightly
more fitting option would be ERRCODE_INVALID_BINARY_REPRESENTATION.
Error codes in postgres are pretty arbitrary though, so either seems
fine to me.



pgsql-hackers by date:

Previous
From: Joe Conway
Date:
Subject: Re: contrib/sepgsql regression tests have been broken for months
Next
From: Luis Felippe
Date:
Subject: Re: [PATCH] Fix ICU strength not being honored in collation rules