Re: [PATCH] Add hints for invalid binary encoding names in encode/decode functions - Mailing list pgsql-hackers

From Daniel Gustafsson
Subject Re: [PATCH] Add hints for invalid binary encoding names in encode/decode functions
Date
Msg-id E9F0329D-64B5-4D25-ACD1-0FBA1226CF39@yesql.se
Whole thread Raw
In response to Re: [PATCH] Add hints for invalid binary encoding names in encode/decode functions  (Chao Li <li.evan.chao@gmail.com>)
Responses Re: [PATCH] Add hints for invalid binary encoding names in encode/decode functions
List pgsql-hackers
> On 10 Nov 2025, at 10:06, Chao Li <li.evan.chao@gmail.com> wrote:
>> On Nov 8, 2025, at 14:25, Sugamoto Shinya <shinya34892@gmail.com> wrote:

>> This patch adds an error hint listing the valid encoding names,
>> so users can immediately see the supported options.

+1.

> I think hardcoding the encoding list is fragile. AFAIK, “base64url” was newly added just a couple of months ago.
>
> The list is defined in encode.c (search for enclist in the file), I guess we can add a function to return a string
witha encoding names. 

New encodings are added very infrequently, we can revisit this if that changes
but till then I think the simplicity of a hardcoded string is preferrable.

--
Daniel Gustafsson




pgsql-hackers by date:

Previous
From: Daniel Gustafsson
Date:
Subject: Re: Minor adjustment: Update the range of the commit_siblings parameter.
Next
From: Tomas Vondra
Date:
Subject: Re: should we have a fast-path planning for OLTP starjoins?