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 1nFzjg-0004V3-VD for pgsql-general@arkaria.postgresql.org; Fri, 04 Feb 2022 14:38:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nFzjf-0006SZ-JM for pgsql-general@arkaria.postgresql.org; Fri, 04 Feb 2022 14:38:51 +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 1nFzjf-0006SQ-93 for pgsql-general@lists.postgresql.org; Fri, 04 Feb 2022 14:38:51 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nFzjY-000139-Nr for pgsql-general@lists.postgresql.org; Fri, 04 Feb 2022 14:38:50 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 214Ecfvp388085; Fri, 4 Feb 2022 09:38:43 -0500 From: Tom Lane To: Matthias Apitz cc: pgsql-general@lists.postgresql.org Subject: Re: sort order for UTF-8 char column with Japanese UTF-8 In-reply-to: <20220204082905.GA28@sh4-5.1blu.de> References: <253777.1643900437@sss.pgh.pa.us> <20220204082905.GA28@sh4-5.1blu.de> Comments: In-reply-to Matthias Apitz message dated "Fri, 04 Feb 2022 09:29:05 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <388083.1643985521.1@sss.pgh.pa.us> Date: Fri, 04 Feb 2022 09:38:41 -0500 Message-ID: <388084.1643985521@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Matthias Apitz writes: > Said that, does the SORT done by the server depends on the environment > (LANG, LC_*) in which the PostgreSQL server is started or only of the > sp_catalog information of the database in question? We set LC_COLLATE and LC_CTYPE from the database's relevant pg_database fields. The remaining LC environment variables shouldn't affect this (and I think we force them to "C" anyway). regards, tom lane