On Sun, 2012-03-11 at 11:20 -0700, Jeff Davis wrote:
> The problem seems to be in check_locale(), which just checks for a
> non-NULL return value from setlocale(). However, the manual for
> setlocale() says:
>
> If locale is "", each part of the locale that should be modified
> is set according to the environment variables. The details
> are implementation-dependent.
Trivial patch attached.
Regards,
Jeff Davis
*** a/src/backend/utils/adt/pg_locale.c
--- b/src/backend/utils/adt/pg_locale.c
***************
*** 229,234 **** check_locale(int category, const char *value)
--- 229,241 ----
char *save;
bool ret;
+ /*
+ * The empty string is not a valid locale; it causes the locale to be set
+ * from the environment, which is not what we want.
+ */
+ if (strcmp(value, "") == 0)
+ return false;
+
save = setlocale(category, NULL);
if (!save)
return false; /* won't happen, we hope */
--
Sent via pgsql-bugs mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs