Re: [PATCH] Add hints for invalid binary encoding names in encode/decode functions

Поиск
Список
Период
Сортировка
От Daniel Gustafsson
Тема Re: [PATCH] Add hints for invalid binary encoding names in encode/decode functions
Дата
Msg-id E9F0329D-64B5-4D25-ACD1-0FBA1226CF39@yesql.se
обсуждение исходный текст
Ответ на Re: [PATCH] Add hints for invalid binary encoding names in encode/decode functions  (Chao Li <li.evan.chao@gmail.com>)
Ответы Re: [PATCH] Add hints for invalid binary encoding names in encode/decode functions
Список 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 по дате отправления: