From 211dfc48f879b70fe18326f42bcd29ccefdf2c03 Mon Sep 17 00:00:00 2001 From: Jeff Davis Date: Wed, 9 Nov 2022 13:56:19 -0800 Subject: [PATCH v3 5/5] Allow windows to use varlenafastcmp_locale. Now that the combination of windows with the libc provider and UTF-8 for the database encoding is handled by pg_collate_libc(), we can support varlenafastcmp_locale for windows as well. --- src/backend/utils/adt/varlena.c | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/src/backend/utils/adt/varlena.c b/src/backend/utils/adt/varlena.c index 5ebfe3acb7..e23c2ca31e 100644 --- a/src/backend/utils/adt/varlena.c +++ b/src/backend/utils/adt/varlena.c @@ -1887,20 +1887,6 @@ varstr_sortsupport(SortSupport ssup, Oid typid, Oid collid) */ locale = pg_newlocale_from_collation(collid); - /* - * There is a further exception on Windows. When the database - * encoding is UTF-8 and we are not using the C collation, complex - * hacks are required. We don't currently have a comparator that - * handles that case, so we fall back on the slow method of having the - * sort code invoke bttextcmp() (in the case of text) via the fmgr - * trampoline. ICU locales work just the same on Windows, however. - */ -#ifdef WIN32 - if (GetDatabaseEncoding() == PG_UTF8 && - !(locale && locale->provider == COLLPROVIDER_ICU)) - return; -#endif - /* * We use varlenafastcmp_locale except for type NAME. */ -- 2.34.1