Re: encoding of PostgreSQL messages

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Hiroshi Inoue <inoue(at)tpf(dot)co(dot)jp>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, Bruce Momjian <bruce(at)momjian(dot)us>, Karsten Hilbert <Karsten(dot)Hilbert(at)gmx(dot)net>, pgsql-general(at)postgresql(dot)org
Subject: Re: encoding of PostgreSQL messages
Date: 2009-02-11 01:04:17
Message-ID: 27818.1234314257@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hiroshi Inoue <inoue(at)tpf(dot)co(dot)jp> writes:
> I'm thinking of the following steps in the backend code.

> 1.Set LC_MESSAGES to "C" until the client_encoding is
> determined.
> 2.When a client_encoding is specifed in the startup
> message, bind the corrsponding codeset to the
> textdomain and set LC_MESSAGES to the specified one
> in the startup message or restore the LC_MESSAGES
> overridden by step 1 before authorization step.
> Then we can see properly localized authorization
> failure messages.

> 3.Reset LC_MESSAGES to the current one in Initialize
> ClientEncoding() and unbind the codeset if necessary
> in SetDatabaseEncoding().

Reflecting on the bigger picture ... I would imagine that the vast
majority of existing applications depend on client_encoding settings
that come from postgresql.conf, ALTER USER SET, ALTER DATABASE SET, or
just the default (== database encoding). I don't think a solution that
penalizes those cases and makes only the case of setting it via
PGCLIENTENCODING work nicely is going to make very many people happy.

Mind you, I don't really know how to do better, but I do see that the
case of client_encoding being specified in the startup message is
not going to help enough people to be particularly useful.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Sebastian Böhm 2009-02-11 02:24:06 Intel SSD
Previous Message Tom Lane 2009-02-11 00:46:46 Re: Continual increase of age(datfrozenxid) for template0