aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2007-02-13 02:00:55 +0000
committerBruce Momjian <bruce@momjian.us>2007-02-13 02:00:55 +0000
commitd1d3f4d0150d3b3d96b9353d93c676abcf4f074b (patch)
treefd369bcc1b34be0e2d701924cd6f4025b605bd39 /src
parent33c4a77f2963ffa0004796c60faff791a0e40f5c (diff)
downloadpostgresql-d1d3f4d0150d3b3d96b9353d93c676abcf4f074b.tar.gz
postgresql-d1d3f4d0150d3b3d96b9353d93c676abcf4f074b.zip
Add comment that to_char() for broken glibc pt_BR might cause a problem.
Diffstat (limited to 'src')
-rw-r--r--src/backend/utils/adt/formatting.c28
1 files changed, 16 insertions, 12 deletions
diff --git a/src/backend/utils/adt/formatting.c b/src/backend/utils/adt/formatting.c
index 37e1ccd9a9c..74e2db6082d 100644
--- a/src/backend/utils/adt/formatting.c
+++ b/src/backend/utils/adt/formatting.c
@@ -1,7 +1,7 @@
/* -----------------------------------------------------------------------
* formatting.c
*
- * $PostgreSQL: pgsql/src/backend/utils/adt/formatting.c,v 1.122 2007/02/09 04:17:58 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/adt/formatting.c,v 1.123 2007/02/13 02:00:55 momjian Exp $
*
*
* Portions Copyright (c) 1999-2007, PostgreSQL Global Development Group
@@ -3835,14 +3835,6 @@ NUM_prepare_locale(NUMProc *Np)
Np->L_positive_sign = "+";
/*
- * Number thousands separator
- */
- if (lconv->thousands_sep && *lconv->thousands_sep)
- Np->L_thousands_sep = lconv->thousands_sep;
- else
- Np->L_thousands_sep = ",";
-
- /*
* Number decimal point
*/
if (lconv->decimal_point && *lconv->decimal_point)
@@ -3850,6 +3842,21 @@ NUM_prepare_locale(NUMProc *Np)
else
Np->decimal = ".";
+ if (!IS_LDECIMAL(Np->Num))
+ Np->decimal = ".";
+
+ /*
+ * Number thousands separator
+ *
+ * Some locales (e.g. broken glibc pt_BR), have a comma for
+ * decimal, but "" for thousands_sep, so we might make the
+ * thousands_sep comma too. 2007-02-12
+ */
+ if (lconv->thousands_sep && *lconv->thousands_sep)
+ Np->L_thousands_sep = lconv->thousands_sep;
+ else
+ Np->L_thousands_sep = ",";
+
/*
* Currency symbol
*/
@@ -3857,9 +3864,6 @@ NUM_prepare_locale(NUMProc *Np)
Np->L_currency_symbol = lconv->currency_symbol;
else
Np->L_currency_symbol = " ";
-
- if (!IS_LDECIMAL(Np->Num))
- Np->decimal = ".";
}
else
{