Re: BUG #19410: Cannot ser client_encoding

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: "615695028(at)qq(dot)com" <615695028(at)qq(dot)com>, "pgsql-bugs(at)lists(dot)postgresql(dot)org" <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: BUG #19410: Cannot ser client_encoding
Date: 2026-02-15 15:10:33
Message-ID: 911028.1771168233@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

"David G. Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> writes:
> On Saturday, February 14, 2026, PG Bug reporting form <
> noreply(at)postgresql(dot)org> wrote:
>> [ SET doesn't persist across sessions ]

> Everything you’ve shown worked as expected.

Indeed. I suggest reading

https://www.postgresql.org/docs/current/config-setting.html

which not only explains that the effects of SET are per-session,
but lists all the other ways to adjust a server setting.

> If you want to always use UTF-8 I’d suggest you figure out how to configure
> your client to do so. psql will then just auto-detect whatever is actually
> in use. It doesn’t really make sense to use SET with client_encoding.

Yeah, that's an orthogonal issue: you really need client_encoding to
match whatever your terminal window is using, or non-ASCII characters
won't display correctly. So letting psql deduce it from environment
is usually the right thing.

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Andrey Borodin 2026-02-15 18:11:32 Re: 17.8 standby crashes during WAL replay from 17.5 primary: "could not access status of transaction"
Previous Message David G. Johnston 2026-02-15 14:55:27 BUG #19410: Cannot ser client_encoding