Add HINT listing valid encodings to encode() and decode() errors.
Fujii Masao <fujii@postgresql.org>
Add HINT listing valid encodings to encode() and decode() errors. This commit updates encode() and decode() so that when an invalid encoding is specified, their error message includes a HINT listing all valid encodings. This helps users quickly see which encodings are supported without needing to consult the documentation. Author: Shinya Sugamoto <shinya34892@gmail.com> Reviewed-by: Chao Li <lic@highgo.com> Reviewed-by: Daniel Gustafsson <daniel@yesql.se> Reviewed-by: Masahiko Sawada <sawada.mshk@gmail.com> Reviewed-by: Peter Eisentraut <peter@eisentraut.org> Reviewed-by: Nathan Bossart <nathandbossart@gmail.com> Reviewed-by: Fujii Masao <masao.fujii@gmail.com> Discussion: https://postgr.es/m/CAAe3y+99sfPv8UDF1VM-rC1i5HBdqxUh=2HrbJJFm2+i=1OwOw@mail.gmail.com
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/utils/adt/encode.c | modified | +6 −2 |
| src/test/regress/expected/strings.out | modified | +7 −0 |
| src/test/regress/sql/strings.sql | modified | +4 −0 |
Discussion
- [PATCH] Add hints for invalid binary encoding names in encode/decode functions 28 messages · 2025-11-08 → 2025-11-20