aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2010-04-26 14:17:52 +0000
committerBruce Momjian <bruce@momjian.us>2010-04-26 14:17:52 +0000
commit7eb6e6b48adfe89861923e83aee9f697c50275b0 (patch)
tree8c257415c8351280837b5dd61b0b64db38382802
parentab93cd9b053446dfb64f66bfac97787eb74c1172 (diff)
downloadpostgresql-7eb6e6b48adfe89861923e83aee9f697c50275b0.tar.gz
postgresql-7eb6e6b48adfe89861923e83aee9f697c50275b0.zip
Add comments about why we set LC_CTYPE in WIN32 for time when we don't
actually access it, per information from Hiroshi.
-rw-r--r--src/backend/utils/adt/pg_locale.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/backend/utils/adt/pg_locale.c b/src/backend/utils/adt/pg_locale.c
index 33297accab6..5b4d1736c76 100644
--- a/src/backend/utils/adt/pg_locale.c
+++ b/src/backend/utils/adt/pg_locale.c
@@ -4,7 +4,7 @@
*
* Portions Copyright (c) 2002-2010, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/backend/utils/adt/pg_locale.c,v 1.55 2010/04/24 22:54:56 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/adt/pg_locale.c,v 1.56 2010/04/26 14:17:52 momjian Exp $
*
*-----------------------------------------------------------------------
*/
@@ -627,7 +627,15 @@ cache_locale_time(void)
save_lc_time = pstrdup(save_lc_time);
#ifdef WIN32
- /* See the WIN32 comment near the top of PGLC_localeconv() */
+ /*
+ * On WIN32, there is no way to get locale-specific time values in a
+ * specified locale, like we do for monetary/numeric. We can only get
+ * CP_ACP (see strftime_win32) or UTF16. Therefore, we get UTF16 and
+ * convert it to the database locale. However, wcsftime() internally
+ * uses LC_CTYPE, so we set it here. See the WIN32 comment near the
+ * top of PGLC_localeconv().
+ */
+
/* save user's value of ctype locale */
save_lc_ctype = setlocale(LC_CTYPE, NULL);
if (save_lc_ctype)