pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: psql: Fall back to English for unsafe hidden query labels.
Date: Wed, 21 Oct 2026 14:34:54 +0000
Message-ID: <E1xJXP4-00000000CLL-1xxT@gemulon.postgresql.org> (raw)

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@gmail.com>
Reviewed-by: Fujii Masao <masao.fujii@gmail.com>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.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(-)



view thread (2+ messages)  latest in thread

Message-ID: <E1xJXP4-00000000CLL-1xxT@gemulon.postgresql.org>
Permalink:  ../E1xJXP4-00000000CLL-1xxT@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1xJXP4-00000000CLL-1xxT@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: psql: Fall back to English for unsafe hidden query labels.
  In-Reply-To: <E1xJXP4-00000000CLL-1xxT@gemulon.postgresql.org>
  References: <E1xJXP4-00000000CLL-1xxT@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox