Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aiXSw-0000mA-85 for pgsql-bugs@arkaria.postgresql.org; Wed, 23 Mar 2016 01:20:06 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1aiXSu-0004Tj-RC for pgsql-bugs@arkaria.postgresql.org; Wed, 23 Mar 2016 01:20:04 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1aiXSu-0004TS-Ct for pgsql-bugs@postgresql.org; Wed, 23 Mar 2016 01:20:04 +0000 Received: from tamriel.snowman.net ([2001:4830:167b::11]) by makus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aiXSr-0001wY-3K for pgsql-bugs@postgresql.org; Wed, 23 Mar 2016 01:20:03 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id 7ACD55F794; Tue, 22 Mar 2016 21:20:00 -0400 (EDT) Date: Tue, 22 Mar 2016 21:20:00 -0400 From: Stephen Frost To: Tom Lane Cc: Robert Haas , Peter Geoghegan , Marc-Olaf Jaschke , Postgres-Bugs Subject: Re: Missing rows with index scan when collation is not "C" (PostgreSQL 9.5) Message-ID: <20160323012000.GK3127@tamriel.snowman.net> References: <111D0E27-A8F3-4A84-A4E0-B0FB703863DF@s24.com> <9688.1458605021@sss.pgh.pa.us> <16214.1458615257@sss.pgh.pa.us> <19132.1458688784@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="h6kYMYtSOeQy+8K8" Content-Disposition: inline In-Reply-To: <19132.1458688784@sss.pgh.pa.us> X-Editor: Vim http://www.vim.org/ X-Info: http://www.snowman.net X-Operating-System: Linux/3.13.0-77-generic (x86_64) X-Uptime: 21:19:13 up 28 days, 22:12, 7 users, load average: 0.01, 0.06, 0.12 User-Agent: Mutt/1.5.21 (2010-09-15) X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org --h6kYMYtSOeQy+8K8 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Tom Lane (tgl@sss.pgh.pa.us) wrote: > Robert Haas writes: > > I was a little worried that it was too much to hope for that all libc > > vendors on earth would ship a strxfrm() implementation that was actually > > consistent with strcoll(), and here we are. >=20 > Indeed. To try to put some scope on the problem, I made an idiot little > program that just generates some random UTF8 strings and sees whether > strcoll and strxfrm sort them alike. Attached are that program, a even > more idiot little shell script that runs it over all available UTF8 > locales, and the results on my RHEL6 box. While de_DE seems to be the > worst-broken locale, it's far from the only one. >=20 > Please try this on as many platforms as you can get hold of ... Results for Ubuntu 14.04: sfrost@dwemer:/home/sfrost> sh tryalllocales.sh =20 Using LC_COLLATE =3D "C.UTF-8" Using LC_CTYPE =3D "en_US.UTF-8" C.UTF-8 good Using LC_COLLATE =3D "de_DE.utf8" Using LC_CTYPE =3D "en_US.UTF-8" inconsistency between strcoll (36) and strxfrm (35) orders inconsistency between strcoll (35) and strxfrm (36) orders inconsistency between strcoll (160) and strxfrm (159) orders inconsistency between strcoll (159) and strxfrm (160) orders inconsistency between strcoll (347) and strxfrm (346) orders inconsistency between strcoll (348) and strxfrm (347) orders inconsistency between strcoll (346) and strxfrm (348) orders inconsistency between strcoll (355) and strxfrm (353) orders inconsistency between strcoll (353) and strxfrm (354) orders inconsistency between strcoll (354) and strxfrm (355) orders inconsistency between strcoll (440) and strxfrm (439) orders inconsistency between strcoll (441) and strxfrm (440) orders inconsistency between strcoll (439) and strxfrm (441) orders inconsistency between strcoll (450) and strxfrm (449) orders inconsistency between strcoll (449) and strxfrm (450) orders inconsistency between strcoll (454) and strxfrm (452) orders inconsistency between strcoll (455) and strxfrm (453) orders inconsistency between strcoll (452) and strxfrm (454) orders inconsistency between strcoll (453) and strxfrm (455) orders inconsistency between strcoll (521) and strxfrm (520) orders inconsistency between strcoll (520) and strxfrm (521) orders inconsistency between strcoll (529) and strxfrm (528) orders inconsistency between strcoll (528) and strxfrm (529) orders inconsistency between strcoll (682) and strxfrm (681) orders inconsistency between strcoll (681) and strxfrm (682) orders inconsistency between strcoll (743) and strxfrm (742) orders inconsistency between strcoll (742) and strxfrm (743) orders inconsistency between strcoll (830) and strxfrm (829) orders inconsistency between strcoll (829) and strxfrm (830) orders inconsistency between strcoll (870) and strxfrm (869) orders inconsistency between strcoll (869) and strxfrm (870) orders inconsistency between strcoll (933) and strxfrm (931) orders inconsistency between strcoll (931) and strxfrm (932) orders inconsistency between strcoll (932) and strxfrm (933) orders de_DE.utf8 BAD Using LC_COLLATE =3D "en_US.utf8" Using LC_CTYPE =3D "en_US.UTF-8" en_US.utf8 good Thanks! Stephen --h6kYMYtSOeQy+8K8 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJW8e8/AAoJEO1sijiDR2RV2YYP/3vfPF9wLMI/2yPA4s2Ggc5I pYsGpU3h7WyKlsP8T3tQZvTAuKZWNRe2KzgFnyFZhzsiG1R+vTIG2gGTgVESoeCi vHHb/Ny18M+1RnJcrbOHVU/zLHRFI4BCyexiOn7TL2aQFgaRhWRZJlKXGjEuY8O5 XxFZg0HZYSeA8hxuxbpHtocHghPCJIt7vXjvpaMHgYYyuFFtJ5HY1hmP4prhK3wM I3p2VPseFpYE+bRbF4aM1mp6MareR091zItxYKCiOt73cHYYgXp23F6+1PoFevtc u5uEjjowTYF8jVwffhpN3jq2R90yoZqS8KOdma0RUx3WXGelfSNTRQ9XvJpACYp7 1cpGMGI4821AdpWF9v7jN+Hbi5PxMOxsRFM5a1A8SxuVg5wZwWFoK6ewson75pSW IVevF5eZjMXLqu3yrNs1OWe8QACcyocvgpoErb73YZ9rwtlyOkvIvLmBgJ4CW1xW zSm9KBN2h55qNF5j283ho+BHEeW0bnfHyvZ2W4MHwIKx3qVh12prm0UmkWb4LHit stvyH2d8IxdWskwnXbTYHEr7SWk2+hMCwLId4mCk5ROga2RKdq/MeC/PwXrfriAx nLPrmPpiW9zQpHAiT/IvTLvmDFEhfPpW/Aea9IXTfd8q88ZjlnB5/Vc4ngakGxTi ErbtDS0xf/DDx8cIuzJc =m1EX -----END PGP SIGNATURE----- --h6kYMYtSOeQy+8K8--