solution! (was: Re: problem with float8 input format) - Mailing list pgsql-general

From Louis-David Mitterrand
Subject solution! (was: Re: problem with float8 input format)
Date
Msg-id 20000812165717.A9065@styx
Whole thread Raw
In response to Re: problem with float8 input format  (Louis-David Mitterrand <cunctator@apartia.ch>)
Responses Re: solution! (was: Re: problem with float8 input format)  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
On Fri, Aug 11, 2000 at 10:07:39PM +0200, Louis-David Mitterrand wrote:
> On Fri, Aug 11, 2000 at 11:42:06AM -0400, Tom Lane wrote:
> > Louis-David Mitterrand <cunctator@apartia.ch> writes:
> > > Strangely engough the function call works fine when called from psql but
> > > fails (but not always!) from a C trigger.
> >
> > May we see the C trigger?  I'm suspicious it's doing something wrong...
> >
>
> Please find the trigger attached to this message as well as the .sql
> file containing the full DB schema including the functions. Here is a
> typicall log entry of the error:

Finally I found the problem:

    bindtextdomain("apartia_com", "/usr/local/auction/locale");
    textdomain("apartia_com");
    setlocale(LC_ALL, seller_locale);

When "seller_locale" is, for instance, "de_DE", then I get theses
errors:

    ERROR: Bad float8 input format '0.05'

Is Postgres expecting the float as 0,05 (notice the comma) because of
the locale?

When "seller_locale" is "en_US" all is well.

(C trigger is attached)

--
Louis-David Mitterrand - ldm@apartia.org - http://www.apartia.org

 "When I give food to the poor I am called a saint, when I ask why
  they go hungry I am called a communist"
   --Bishop Helder Camara

Attachment

pgsql-general by date:

Previous
From: Louis-David Mitterrand
Date:
Subject: Re: problem with float8 input format
Next
From: "Pawel"
Date:
Subject: changing NAMEDATALEN