Re: Encoding of early PG messages

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Shay Rojansky <roji(at)roji(dot)org>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Encoding of early PG messages
Date: 2015-07-31 13:46:29
Message-ID: 4678.1438350389@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Shay Rojansky <roji(at)roji(dot)org> writes:
> Developing Npgsql I've encountered the problem described in
> http://www.postgresql.org/message-id/20081223212414.GD3894@merkur.hilbert.loc:
> a German installation of PostgreSQL seems to respond to an incorrect
> password with a non-UTF8 encoding of the error messages, even if the
> startup message contains client_encoding=UTF8.

I wouldn't hold your breath waiting for that to change.

A possible workaround is to run the postmaster with lc_messages=C and
then switch to your desired message language per-session. It would
certainly work to send lc_messages along with client_encoding in the
startup packet; or possibly you could set those settings as per-database
or per-role settings to avoid needing to teach the application code
about it. This would mean that bad-password and similar errors would
come out in English, but at least they'd be validly encoded ...

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2015-07-31 13:50:43 Re: 64-bit XIDs again
Previous Message Shulgin, Oleksandr 2015-07-31 13:45:43 Re: deparsing utility commands