Re: [PATCH] Add hints for invalid binary encoding names in encode/decode functions
| От | Peter Eisentraut |
|---|---|
| Тема | Re: [PATCH] Add hints for invalid binary encoding names in encode/decode functions |
| Дата | |
| Msg-id | c5c937dc-de8e-4284-be25-5d5eaf089d00@eisentraut.org обсуждение исходный текст |
| Ответ на | Re: [PATCH] Add hints for invalid binary encoding names in encode/decode functions (Chao Li <li.evan.chao@gmail.com>) |
| Список | pgsql-hackers |
On 10.11.25 10:06, Chao Li wrote:
> 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.
>
> 2
> ```
> + errhint("Valid binary encodings are: %s",
> + "\"hex\", \"base64\", \"base64url\", \"escape\".")));
> ```
>
> Looks like putting punctuation inside %s is not normal. By looking at other hint messages, they usually do something
like:
>
> ```
> errhint("Perhaps you meant the option \"%s\".”, value)
> ```
Yes, this is because the punctuation is itself subject to translation.
(Most obviously, different languages use different quotation marks.) So
the preferred style is something like
errhint("Valid encodings are: \"%s\", \"%s\", and \"%s\", "hex", ...)
or however many you need.
See also
<https://www.postgresql.org/message-id/202511070936.jj4o4ktd4b6l%40alvherre.pgsql>
for a related discussion.
В списке pgsql-hackers по дате отправления: