Add HINT listing valid encodings to encode() and decode() errors.
authorFujii Masao <[email protected]>
Thu, 20 Nov 2025 00:14:02 +0000 (09:14 +0900)
committerFujii Masao <[email protected]>
Thu, 20 Nov 2025 00:14:02 +0000 (09:14 +0900)
commit99780da7209605bf9f226eac3eac30ab2bc9427c
tree9c9eb7b857018fa45001fba3ed6a9fb5ffdce6d8
parent6b46669883fac9521c20fe4e2c55ccfbee778591
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 <[email protected]>
Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Daniel Gustafsson <[email protected]>
Reviewed-by: Masahiko Sawada <[email protected]>
Reviewed-by: Peter Eisentraut <[email protected]>
Reviewed-by: Nathan Bossart <[email protected]>
Reviewed-by: Fujii Masao <[email protected]>
Discussion: https://postgr.es/m/CAAe3y+99sfPv8UDF1VM-rC1i5HBdqxUh=2HrbJJFm2+i=1OwOw@mail.gmail.com
src/backend/utils/adt/encode.c
src/test/regress/expected/strings.out
src/test/regress/sql/strings.sql