Re: lc_numeric and decimal delimiter

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Gavin Sherry <swm(at)linuxworld(dot)com(dot)au>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: lc_numeric and decimal delimiter
Date: 2005-11-09 02:28:41
Message-ID: 43715ED9.2040500@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Gavin Sherry wrote:

>Hi all,
>
>I am at OpenDBCon in Germany. People are complaining about floats/numerics
>not accepting German/European conventions for the delimiter point -- a
>comma. This is hard coded into the the numeric input parser but,
>naturally, we use strtod() in else where. I'm not sure about the locale
>stuff and whether it deals with it. Are we in the wrong here?
>
>

If we are it is apparently by design. pg_locale.c says:

* The other categories, LC_MONETARY, LC_NUMERIC, and LC_TIME are also
* settable at run-time. However, we don't actually set those locale
* categories permanently. This would have bizarre effects like no
* longer accepting standard floating-point literals in some locales.
* Instead, we only set the locales briefly when needed, cache the
* required information obtained from localeconv(), and set them back.
* The cached information is only used by the formatting functions
* (to_char, etc.) and the money type.

Personally, I am inclined to think there should at least be a setting
that allows input according to locale settings, even if it would
disallow "standard" floating point strings. Maybe one of the protesting
Europeans would like to make a proposal?

cheers

andrew

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Creager 2005-11-09 03:29:25 Re: SIGSEGV taken on 8.1 during dump/reload
Previous Message Christopher Kings-Lynne 2005-11-09 02:16:04 Re: Supporting NULL elements in arrays