pgsql: psql: Fall back to English for unsafe hidden query labels.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: psql: Fall back to English for unsafe hidden query labels.
Date: 2026-10-21 14:34:54
Message-ID: E1xJXP4-00000000CLL-1xxT@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

psql: Fall back to English for unsafe hidden query labels.

This completes the project begun in commit 294d2196c of making
commit 41d69e6dc's hidden query labels safe against unexpected
encoding-related failures. At that point we were still uncertain
exactly what rule to use to decide that a translated label is safe.
The rule adopted here is: translate the label only when the client
and server encodings match and the translated bytes pass the same
encoding verification check the server will apply. This is enough
to ensure that no error will be thrown, and it avoids the difficult
task of identifying what encoding gettext() thinks it's using.

Author: shihao zhong <zhong950419(at)gmail(dot)com>
Reviewed-by: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Reviewed-by: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Discussion: https://postgr.es/m/CAGRkXqRv7yhBOhF0YvSr6ZB7rvsPCjnXSPj8=3bKcSJuYvNrBA@mail.gmail.com
Backpatch-through: 19

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/e7ba5eb899884693ad8d9c62fa7a23f155a4a350

Modified Files
--------------
src/bin/psql/common.c | 25 +++++++++++++++++++++++--
1 file changed, 23 insertions(+), 2 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Fujii Masao 2026-10-21 14:39:17 pgsql: doc: Correct psql's \d+x documentation for sequences
Previous Message Jeff Davis 2026-10-21 12:55:01 pgsql: Fix ILIKE patterns with non-ASCII bytes in single-byte encodings