Re: Chinese translations not applied correctly on PostgreSQL 18 Windows

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: elodie <beifu23(at)foxmail(dot)com>
Cc: pgsql-bugs <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: Chinese translations not applied correctly on PostgreSQL 18 Windows
Date: 2026-04-23 21:28:55
Message-ID: 1497613.1776979735@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

"=?utf-8?B?ZWxvZGll?=" <beifu23(at)foxmail(dot)com> writes:
> Steps to reproduce:
> 1. Install PostgreSQL 18 on Windows
> 2. Set environment: LANG=zh_CN, chcp 936
> 3. Run psql and execute: INSERT INTO tb (c) VALUES ('a\O\0');

Setting that environment variable isn't sufficient. It'll cause
psql to translate messages that it generates locally, but to get
translated messages from the server, you need to set the server's
lc_messages parameter. I speak no Chinese, so I can't really
read your example, but here's an example using French:

$ LANG=fr_FR.utf8 psql
psql (19devel)
Saisissez « help » pour l'aide.

postgres=# select 1/0;
ERROR: division by zero
postgres=# set lc_messages = 'fr_FR';
SET
postgres=# select 1/0;
ERREUR: division par zéro

You can use any of the various ways of setting a server parameter
to install that setting on a more permanent basis.

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2026-04-23 21:42:43 Re: pg_dumpall bug exit code 0 with fatal
Previous Message fahar abbas 2026-04-23 19:56:15 Re: Please subscribe