[Pkg-postgresql-public] Bug#700271: Bug#700271: postgresql-9.1: non-obvious choice of database locale

Helmut Grohne helmut at subdivi.de
Wed Feb 13 07:49:13 UTC 2013

On Wed, Feb 13, 2013 at 08:29:53AM +0100, Martin Pitt wrote:
> I mean the default locale of a particular computer that is being used
> if the user who logs in does not specify her own locale settings in
> e. g. .bashrc or from ssh. This is usually set in /etc/default/locale
> or, on older systems, in /etc/environment.

Both /etc/default/locale and /etc/environment are empty on the system in
question.  This likely represents the setting "C" that I usually make
during installation to avoid translation of messages.

> Right, these variables define the locale. System vs. User means where
> they are set, in /etc/ as a default, or by the user as his/her
> preference.

So the user setting appears to override the system setting here. That
appears like a bad idea to me, because the user setting really depends
on the remote system you are logging in from remotely.

In fact would postgresql have used my system setting the database
encoding should have been ASCII, right? Side question: Is there a way to
ask for UTF-8 without translation?

> Ah, so that's what caused your problem? ssh set an invalid/bad locale
> on the server where you set up PostgreSQL? sudo usually passes on
> $LANG, su doesn't, so depending on how you install postgresql you
> would have gotten the local or remote locale.

I sshed directly into the root account. In this case ssh will take the
LANG and LC_* variables from the client system, which in this case yes,
plausibly was responsible for the latin1 choice.

> As a compromise, pg_createcluster (and thus apt-get install) could
> show the locale of the generated cluster. Would that help?

Yes. That would likely have solved the issue in my case, because I would
have been wondering over latin1 in a database. I think that this
shouldn't target wheezy though.

The conclusion appears to be:

retitle 700271 mention database encoding used during installation
tags 700271 - wontfix

Thanks for your helpful reply.


More information about the Pkg-postgresql-public mailing list