Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nFhWF-0008G2-EV for pgsql-general@arkaria.postgresql.org; Thu, 03 Feb 2022 19:11:47 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nFhWE-0007fX-Dh for pgsql-general@arkaria.postgresql.org; Thu, 03 Feb 2022 19:11:46 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nFhWE-0007ev-39 for pgsql-general@lists.postgresql.org; Thu, 03 Feb 2022 19:11:46 +0000 Received: from ms-10.1blu.de ([178.254.4.101]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nFhW8-0008NP-PO for pgsql-general@lists.postgresql.org; Thu, 03 Feb 2022 19:11:45 +0000 Received: from [80.187.70.103] (helo=pureos) by ms-10.1blu.de with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nFhW6-0002kC-3O; Thu, 03 Feb 2022 20:11:38 +0100 Date: Thu, 3 Feb 2022 20:11:35 +0100 From: Matthias Apitz To: Tom Lane Cc: pgsql-general@lists.postgresql.org Subject: Re: sort order for UTF-8 char column with Japanese UTF-8 Message-ID: Reply-To: Matthias Apitz References: <253777.1643900437@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="yf1P4nMkm/USFb7W" Content-Disposition: inline In-Reply-To: <253777.1643900437@sss.pgh.pa.us> X-Operating-System: FreeBSD 13.0-CURRENT r368166 (amd64) X-message-flag: Mails containing HTML will not be read! Please send only plain text. X-Con-Id: 51246 X-Con-U: 0-guru X-Originating-IP: 80.187.70.103 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --yf1P4nMkm/USFb7W Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable El d=C3=ADa jueves, febrero 03, 2022 a las 10:00:37 -0500, Tom Lane escribi= =C3=B3: > Matthias Apitz writes: > > El d=C3=ADa jueves, febrero 03, 2022 a las 11:14:55 +0100, Matthias Api= tz escribi=C3=B3: > >> With ESQL/C on a PostgreSQL 13.1 server I see the result of this query: > >> select katkey,normform from swd_anzeige where normform >=3D 'A' ORDER = BY ASC; > >> coming out in this order: > >> ... > >> I loaded the same table in my server, but can't get the same order with > >> psql: >=20 > Do the two machines produce the same results if you sort the data in > question with sort(1)? (Being careful to set LANG=3Dde_DE.UTF-8 of > course.) I rather doubt this has anything to do with Postgres as such; > there are lots of inter-system and inter-release discrepancies in > collation behavior. I've created a small text file 'swd' with some of the UTF-8 lines in question. On my Linux mobile phone (a Debian Linux) it gives: purism@pureos:~$ LANG=3Dde_DE.UTF-8 sort swd A A010STRUKTUR A010STRUKTUR A010STRUKTUR A0150SUPRALEITER =E3=82=B2=E3=82=A2=E3=83=8F=E3=83=AB=E3=83=88=E3=83=BBA=E3=83=BB=E3=83=AA= =E3=83=83=E3=82=BF=E3=83=BC =E3=82=B2=E3=83=AB=E3=83=8F=E3=83=AB=E3=83=88=E3=83=BBA=E3=83=BB=E3=83=AA= =E3=83=83=E3=82=BF=E3=83=BC =E3=83=81=E3=83=A3=E3=83=BC=E3=83=AB=E3=82=BA=E3=83=BBA=E3=83=BB=E3=83=93= =E3=82=A2=E3=83=BC=E3=83=89 On my FreeBSD laptop the same file sorts as guru@c720-r368166:~ $ LANG=3Dde_DE.UTF-8 sort swd A =E3=82=B2=E3=82=A2=E3=83=8F=E3=83=AB=E3=83=88=E3=83=BBA=E3=83=BB=E3=83=AA= =E3=83=83=E3=82=BF=E3=83=BC =E3=82=B2=E3=83=AB=E3=83=8F=E3=83=AB=E3=83=88=E3=83=BBA=E3=83=BB=E3=83=AA= =E3=83=83=E3=82=BF=E3=83=BC =E3=83=81=E3=83=A3=E3=83=BC=E3=83=AB=E3=82=BA=E3=83=BBA=E3=83=BB=E3=83=93= =E3=82=A2=E3=83=BC=E3=83=89 A010STRUKTUR A010STRUKTUR A010STRUKTUR A0150SUPRALEITER I'll check tomorrow with the admins of the remote server (a SuSE Linux). Thanks for the hint. matthias --=20 Matthias Apitz, =E2=9C=89 guru@unixarea.de, http://www.unixarea.de/ +49-176= -38902045 Public GnuPG key: http://www.unixarea.de/key.pub --yf1P4nMkm/USFb7W Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEM265aJL+n+f2rQHWUpt0I/NggUEFAmH8KNIACgkQUpt0I/Ng gUFVuQf/YZATke+fnjs6XRX2TvCuPv6+bGC5705h3gKdKjbCqx/TF32i5gIUaaBf /LBGLRI6Vq/7esO4ahbeKdVwOKD5vf02VNYKw0Yo/lFe8Dcf9mVRsp+Rgh9yaEZn S5D5Wu6jApuKn6ZBxIWKaCAz5rlR/pRAcYnjfJVaJnQmh0wcJOaRhtS43Wn9l3QU HTuYJICg2l5RAm6SdWvAYFfV9BtCDj08J2zUAHUfH1On0imxccuxbxcnapcr/VRY Yg3KX0nBSE6iW7UOfuDkoMh662psKuszklVjLOKY+nS95IbS12lF1BqBHrPrMmnb Xu8Us86UqepbYeCnthBxiRUWVf9dmg== =elU5 -----END PGP SIGNATURE----- --yf1P4nMkm/USFb7W--