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 1nFZiI-00025s-9B for pgsql-general@arkaria.postgresql.org; Thu, 03 Feb 2022 10:51:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nFZiG-0008Lx-90 for pgsql-general@arkaria.postgresql.org; Thu, 03 Feb 2022 10:51:40 +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 1nFZiF-0008Ln-Us for pgsql-general@lists.postgresql.org; Thu, 03 Feb 2022 10:51:39 +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 1nFZi8-0004Xi-KB for pgsql-general@lists.postgresql.org; Thu, 03 Feb 2022 10:51:38 +0000 Received: from [188.174.57.231] (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 1nFZi5-0007wR-Ac for pgsql-general@lists.postgresql.org; Thu, 03 Feb 2022 11:51:29 +0100 Date: Thu, 3 Feb 2022 11:51:27 +0100 From: Matthias Apitz To: 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: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: 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 El día jueves, febrero 03, 2022 a las 11:14:55 +0100, Matthias Apitz escribió: > > 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? > I forgot to say, both database have: psql -l ... ueisis | sisis | UTF8 | de_DE.UTF-8 | de_DE.UTF-8 | matthias -- Matthias Apitz, ✉ guru@unixarea.de, http://www.unixarea.de/ +49-176-38902045 Public GnuPG key: http://www.unixarea.de/key.pub