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 1nFZ8o-00016l-GV for pgsql-general@arkaria.postgresql.org; Thu, 03 Feb 2022 10:15:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nFZ8n-0003je-6O for pgsql-general@arkaria.postgresql.org; Thu, 03 Feb 2022 10:15:01 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nFZ8m-0003jF-Rp for pgsql-general@lists.postgresql.org; Thu, 03 Feb 2022 10:15:00 +0000 Received: from ms-10.1blu.de ([178.254.4.101]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nFZ8k-0000Um-7D for pgsql-general@lists.postgresql.org; Thu, 03 Feb 2022 10:15:00 +0000 Received: from [188.174.57.231] (helo=localhost.unixarea.de) by ms-10.1blu.de with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nFZ8i-00026l-Np; Thu, 03 Feb 2022 11:14:56 +0100 Received: from localhost.my.domain (localhost [127.0.0.1]) by localhost.unixarea.de (8.16.1/8.14.9) with ESMTPS id 213AEtoX001528 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Thu, 3 Feb 2022 11:14:56 +0100 (CET) (envelope-from guru@unixarea.de) Received: (from guru@localhost) by localhost.my.domain (8.16.1/8.14.9/Submit) id 213AEtLe001527; Thu, 3 Feb 2022 11:14:55 +0100 (CET) (envelope-from guru@unixarea.de) X-Authentication-Warning: localhost.my.domain: guru set sender to guru@unixarea.de using -f Date: Thu, 3 Feb 2022 11:14:55 +0100 From: Matthias Apitz To: pgsql-general@lists.postgresql.org Subject: sort order for UTF-8 char column with Japanese UTF-8 Message-ID: Reply-To: Matthias Apitz MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit 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: 188.174.57.231 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hello, With ESQL/C on a PostgreSQL 13.1 server I see the result of this query: select katkey,normform from swd_anzeige where normform >= 'A' ORDER BY ASC; coming out in this order: query: fetch swd_anzeige_seq RESULT: A query: fetch swd_anzeige_seq RESULT: ゲアハルト・A・リッター query: fetch swd_anzeige_seq RESULT: ゲルハルト・A・リッター query: fetch swd_anzeige_seq RESULT: チャールズ・A・ビアード query: fetch swd_anzeige_seq RESULT: A010STRUKTUR query: fetch swd_anzeige_seq RESULT: A010STRUKTUR query: fetch swd_anzeige_seq RESULT: A010STRUKTUR query: fetch swd_anzeige_seq RESULT: A0150SUPRALEITER I loaded the same table in my server, but can't get the same order with psql: katkey | normform --------+--------------------------------------------------------- 233871 | A ... 92938 | ゲアハルト・A・リッター 92938 | ゲルハルト・A・リッター 92938 | リッター0ゲルハルト・A i.e. the Japanese rows are sorted at the end after all others. Why? Thanks matthias -- Matthias Apitz, ✉ guru@unixarea.de, http://www.unixarea.de/ +49-176-38902045 Public GnuPG key: http://www.unixarea.de/key.pub August 13, 1961: Better a wall than a war. And, while the GDR was still existing, no German troups and bombs have been killed in Yugoslavia, Afghanistan, Afrika...