postgresql/src
Heikki Linnakangas a88b6e4cfb setlocale() on Windows doesn't work correctly if the locale name contains
dots. I previously worked around this in initdb, mapping the known
problematic locale names to aliases that work, but Hiroshi Inoue pointed
out that that's not enough because even if you use one of the aliases, like
"Chinese_HKG", setlocale(LC_CTYPE, NULL) returns back the long form, ie.
"Chinese_Hong Kong S.A.R.". When we try to restore an old locale value by
passing that value back to setlocale(), it fails. Note that you are affected
by this bug also if you use one of those short-form names manually, so just
reverting the hack in initdb won't fix it.

To work around that, move the locale name mapping from initdb to a wrapper
around setlocale(), so that the mapping is invoked on every setlocale() call.

Also, add a few checks for failed setlocale() calls in the backend. These
calls shouldn't fail, and if they do there isn't much we can do about it,
but at least you'll get a warning.

Backpatch to 9.1, where the initdb hack was introduced. The Windows bug
affects older versions too if you set locale manually to one of the aliases,
but given the lack of complaints from the field, I'm hesitent to backpatch.
2011-09-01 11:08:32 +03:00
..
backend setlocale() on Windows doesn't work correctly if the locale name contains 2011-09-01 11:08:32 +03:00
bin setlocale() on Windows doesn't work correctly if the locale name contains 2011-09-01 11:08:32 +03:00
include setlocale() on Windows doesn't work correctly if the locale name contains 2011-09-01 11:08:32 +03:00
interfaces Don't assume that "E" response to NEGOTIATE_SSL_CODE means pre-7.0 server. 2011-08-27 16:37:58 -04:00
makefiles Fix pgxs.mk to always add --dbname=$(CONTRIB_TESTDB) to REGRESS_OPTS. 2011-08-24 15:16:50 -04:00
pl Add another marker. 2011-08-26 18:15:14 -04:00
port setlocale() on Windows doesn't work correctly if the locale name contains 2011-09-01 11:08:32 +03:00
template Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
test Clean up pg_regress --help output 2011-08-30 21:25:10 +03:00
timezone Use consistent format for reporting GetLastError() 2011-08-23 22:00:52 +03:00
tools Detect out of date flex in MSVC builds. 2011-08-30 12:06:32 -04:00
tutorial Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02:00
bcc32.mak Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
DEVELOPERS
Makefile Fix some oversights in distprep and maintainer-clean targets. 2011-03-10 00:04:05 -05:00
Makefile.global.in Make distprep and *clean build targets recurse into all subdirectories. 2011-07-03 13:55:12 -04:00
Makefile.shlib Use single quotes in preference to double quotes for protecting pathnames. 2011-06-15 21:45:23 -04:00
nls-global.mk Add the possibility to pass --flag arguments to xgettext calls 2011-06-27 00:37:21 +03:00
win32.mak Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00