Thread: Locale settings

Locale settings

From
"Tille, Andreas"
Date:
Hello,

I've thought that I would have set my locale settings correctly for
PostgreSQL 7.1.3.  At least I have set my environment variables

         LANG=de_DE@euro
         LC_ALL=de_DE@euro

Do I have to set additional LC_COLLATE and LC_CTYPE to avoid the
following warnings

Apr 22 12:22:13 wr-linux02 postgres[16149]: [2] NOTICE:  pg_setlocale():
'LC_COLLATE=žæ,@žæ,@/locale' cannot be honored.
Apr 22 12:22:13 wr-linux02 postgres[16149]: [3] NOTICE:  pg_setlocale():
'LC_CTYPE=°æ,@°æ,@^P' cannot be honored.

which where caused when I try

        to_char(temperatur, '999D9')

(By the way: It is not really important to get a ',' instead of the '.'
 but would be nice.  My most important concern is to get rid of this
 warning cleanly - which means not by switching of this warning level.)

Kind regards

         Andreas.

Re: Locale settings

From
Tom Lane
Date:
"Tille, Andreas" <TilleA@rki.de> writes:
> I've thought that I would have set my locale settings correctly for
> PostgreSQL 7.1.3.  At least I have set my environment variables
>          LANG=de_DE@euro
>          LC_ALL=de_DE@euro
> Do I have to set additional LC_COLLATE and LC_CTYPE to avoid the
> following warnings

> Apr 22 12:22:13 wr-linux02 postgres[16149]: [2] NOTICE:  pg_setlocale():
> 'LC_COLLATE=��,@��,@/locale' cannot be honored.
> Apr 22 12:22:13 wr-linux02 postgres[16149]: [3] NOTICE:  pg_setlocale():
> 'LC_CTYPE=��,@��,@^P' cannot be honored.

You did not say what platform you are on, but I suspect you are getting
bit by 7.1's nonportable assumptions about behavior of localeconv().
These garbage locale strings could have come from 7.1's assumption that
a string returned by localeconv() will still be valid after changing
settings with setlocale().

Try 7.2.

            regards, tom lane

Re: Locale settings

From
"Tille, Andreas"
Date:
On Mon, 22 Apr 2002, Tom Lane wrote:

> You did not say what platform you are on, but I suspect you are getting
> bit by 7.1's nonportable assumptions about behavior of localeconv().
> These garbage locale strings could have come from 7.1's assumption that
> a string returned by localeconv() will still be valid after changing
> settings with setlocale().
>
> Try 7.2.
Just was in the process of installing the new Debian packages and did now.
IN fac the warning disapears in 7.2.  However, the output is not compliant
with German locale settings (should be ',' instead of '.').  This is not
really important for my case but might be interesting for others.

Kind regards and thanks for the hint

         Andreas.