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

Martin Pitt mpitt at debian.org
Wed Feb 13 07:29:53 UTC 2013

Hello Helmut,

Helmut Grohne [2013-02-13  8:17 +0100]:
> TTBOMK there is no such thing as a "system locale". Can you briefly
> point out what you mean and maybe how I could change it (or point me to
> the corresponding documentation)?

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.

> My best guess at what you might mean would be LANG and LC_*, but this
> can hardly be described as a system thingy.

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

> They are taken from the environment of the connecting ssh client and
> the values defined on the actual system in question are ignored.

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.

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



Martin Pitt                        | http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)

More information about the Pkg-postgresql-public mailing list