Re: NOTICE: pg_setlocale()

Lists: pgsql-bugs
From: pgsql-bugs(at)postgresql(dot)org
To: pgsql-bugs(at)postgresql(dot)org
Subject: NOTICE: pg_setlocale()
Date: 2001-02-14 23:00:16
Message-ID: 200102142300.f1EN0GL37537@hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

fmatheus (fmatheus(at)ic(dot)unicamp(dot)br) reports a bug with a severity of 3
The lower the number the more severe it is.

Short Description
NOTICE: pg_setlocale()

Long Description
Im a Debian user of postgresql version 7.0.3-4.
libc6 and locales 2.2-6. (LANG=pt_BR, but problem stay with en_US)
that is a unstable package so maybe that is fault of libc6.

Sample Code
SELECT to_char(2.4, 'L9990D99');
NOTICE: pg_setlocale(): 'LC_CTYPE=(at)x' cannot be honored.
NOTICE: pg_setlocale(): 'LC_COLLATE=~' cannot be honored..
NOTICE: pg_setlocale(): 'LC_MONETARY=x(at)-^' cannot be honored.d.
to_char
------------
R$ 2,40

No file was uploaded with this report


From: Karel Zak <zakkr(at)zf(dot)jcu(dot)cz>
To: fmatheus(at)ic(dot)unicamp(dot)br, pgsql-bugs(at)postgresql(dot)org
Subject: Re: NOTICE: pg_setlocale()
Date: 2001-02-19 08:47:51
Message-ID: Pine.LNX.3.96.1010219092957.15975B-100000@ara.zf.jcu.cz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs


On Wed, 14 Feb 2001 pgsql-bugs(at)postgresql(dot)org wrote:

> fmatheus (fmatheus(at)ic(dot)unicamp(dot)br) reports a bug with a severity of 3
> The lower the number the more severe it is.
>
> Short Description
> NOTICE: pg_setlocale()
>
> Long Description
> Im a Debian user of postgresql version 7.0.3-4.
> libc6 and locales 2.2-6. (LANG=pt_BR, but problem stay with en_US)
> that is a unstable package so maybe that is fault of libc6.
>
>
>
> Sample Code
> SELECT to_char(2.4, 'L9990D99');
> NOTICE: pg_setlocale(): 'LC_CTYPE= @x' cannot be honored.
> NOTICE: pg_setlocale(): 'LC_COLLATE=đ~ľ' cannot be honored..
> NOTICE: pg_setlocale(): 'LC_MONETARY=xľ(at)-^ů¸' cannot be honored.d.

It's sound as your locales problem, the setlocale(some_ctg, NULL) returns
a mazy data.

The setlocale() manual:

A successful call to setlocale() returns a string that
corresponds to the locale set. This string may be allo-
cated in static storage. The string returned is such that
a subsequent call with that string and its associated cat-
egory will restore that part of the process's locale. The
return value is NULL if the request cannot be honored.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

During first setlocale() call when PG loads current locale setting your
system returns some bad data and if next time PG wants use this data and
put original setting back setlocal() returns for this data NULL (as error).

For me is all right, I use Debian-potato; libc-2.1.3.so, locales
2.1.3-13, PostgreSQL 7.1

Karel


From: Reinhard Max <max(at)suse(dot)de>
To: <fmatheus(at)ic(dot)unicamp(dot)br>, <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: NOTICE: pg_setlocale()
Date: 2001-02-19 12:45:23
Message-ID: Pine.LNX.4.31.0102191342020.25043-100000@cramer.suse.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

Hi,

On Wed, 14 Feb 2001 pgsql-bugs(at)postgresql(dot)org wrote:

> fmatheus (fmatheus(at)ic(dot)unicamp(dot)br) reports a bug with a severity of 3
> The lower the number the more severe it is.
>
> Short Description
> NOTICE: pg_setlocale()
>
> Long Description
> Im a Debian user of postgresql version 7.0.3-4.
> libc6 and locales 2.2-6. (LANG=pt_BR, but problem stay with en_US)
> that is a unstable package so maybe that is fault of libc6.
>
>
>
> Sample Code
> SELECT to_char(2.4, 'L9990D99');
> NOTICE: pg_setlocale(): 'LC_CTYPE= @x' cannot be honored.
> NOTICE: pg_setlocale(): 'LC_COLLATE=ð~µ' cannot be honored..
> NOTICE: pg_setlocale(): 'LC_MONETARY=xµ(at)-^ùž' cannot be honored.d.
> to_char
> ------------
> R$ 2,40

We also had that problem here at SuSE. The glibc people told me that
it is a bug in the current glibc which will be fixed in the next
version.

As a workarround you can try to unset LANG and all LC_* variables.

cu
Reinhard