summaryrefslogtreecommitdiff
path: root/contrib/pg_upgrade
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2014-01-31 02:03:30 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2014-01-31 02:03:52 -0500
commitcd3e0071b8c9e082f5fe903a019d4e474be98e57 (patch)
tree75021933b229815da5e1755f40da671421557937 /contrib/pg_upgrade
parentdb98b313296d1d50f357d58fbcb6572ed1ab018f (diff)
downloadpostgresql-cd3e0071b8c9e082f5fe903a019d4e474be98e57.tar.gz
Allow unrecognized encoding names in locales, as long as they're the same.
The buildfarm says commit 58274728fb8e087049df67c0eee903d9743fdeda doesn't work so well on Windows. This is because the encoding part of Windows locale names can be just a code page number, eg "1252", which we don't consider to be a valid encoding name. Add a check to accept encoding parts that are case-insensitively string equal; this at least ensures that the new code doesn't reject any cases that the old code allowed.
Diffstat (limited to 'contrib/pg_upgrade')
-rw-r--r--contrib/pg_upgrade/check.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/contrib/pg_upgrade/check.c b/contrib/pg_upgrade/check.c
index d52051a6e9..f04707f9c6 100644
--- a/contrib/pg_upgrade/check.c
+++ b/contrib/pg_upgrade/check.c
@@ -437,8 +437,14 @@ equivalent_locale(const char *loca, const char *locb)
if (!chara || !charb)
return (pg_strcasecmp(loca, locb) == 0);
- /* Compare the encoding parts. */
- if (!equivalent_encoding(chara + 1, charb + 1))
+ /*
+ * Compare the encoding parts. Windows tends to use code page numbers for
+ * the encoding part, which equivalent_encoding() won't like, so accept if
+ * the strings are case-insensitive equal; otherwise use
+ * equivalent_encoding() to compare.
+ */
+ if (pg_strcasecmp(chara + 1, charb + 1) != 0 &&
+ !equivalent_encoding(chara + 1, charb + 1))
return false;
/*