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
---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings