Re: BUG #1583: Locale problem - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #1583: Locale problem
Date
Msg-id 20357.1114291096@sss.pgh.pa.us
Whole thread Raw
In response to BUG #1583: Locale problem  ("Andrew Grillet" <andrew@grillet.co.uk>)
List pgsql-bugs
Andrew Grillet <andrew@grillet.co.uk> writes:
> Fix is found ...
> the default .csrc file set the locale to
> en_GB.ISO_5589-1

> but the correct setting is
> en_GB.ISO5589-1

> So the locale was set to an invalid setting. This has undesirable side
> effects.

Indeed ;-)

> It might be worth adding to the manual that
> --------------------8<---------------------
> In FreeBSD the selected locale  can be viewed by
> > locale

> and  available locales can be viewed by
> > locale -a

> if one or both of the above give improbable results, check
> your .csrc, .shrc and .profile.
> --------------------8<---------------------

Hmm, is this advice FreeBSD-specific?

I tried it on Linux and HP-UX, and in both cases "locale" made it
perfectly clear that there was something wrong:

$ LANG=bogus locale
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=bogus
LC_CTYPE="bogus"
LC_NUMERIC="bogus"
LC_TIME="bogus"
LC_COLLATE="bogus"
LC_MONETARY="bogus"
LC_MESSAGES="bogus"
LC_PAPER="bogus"
LC_NAME="bogus"
LC_ADDRESS="bogus"
LC_TELEPHONE="bogus"
LC_MEASUREMENT="bogus"
LC_IDENTIFICATION="bogus"
LC_ALL=
$

$ LANG=bogus locale

Warning! One or more of your selected locales are not available.
Please invoke the commands "locale" and "locale -a" to verify your
selections and the available locales.

Continuing processing using the "C" locale.

LANG=bogus
LC_CTYPE="C"
LC_COLLATE="C"
LC_MONETARY="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_MESSAGES="C"
LC_ALL=
$

I'm thinking we should (perhaps already do) mention the use of "locale"
to check for valid locale settings, but maybe it's not mentioned in the
most useful places.  Where were you thinking of inserting the above
snippet, anyway?

Anyone else have comments to make on this?

            regards, tom lane

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #1608: integer negative limit in plpgsql function arguments
Next
From: "Magnus Hagander"
Date:
Subject: Re: BUG #1613: Installation flaw