Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hMBtG-0003QU-Mu for pgsql-general@arkaria.postgresql.org; Thu, 02 May 2019 13:36:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hMBtC-0004JP-PX for pgsql-general@arkaria.postgresql.org; Thu, 02 May 2019 13:36:42 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hMBtC-0004Ir-CJ for pgsql-general@lists.postgresql.org; Thu, 02 May 2019 13:36:42 +0000 Received: from mail.verite.pro ([185.16.44.216]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hMBt9-0004Qd-Er for pgsql-general@postgresql.org; Thu, 02 May 2019 13:36:41 +0000 Received: from genius-map.net (verite.pro [195.154.189.246]) by mail.verite.pro (Postfix) with ESMTP id 7BA468C00D5; Thu, 2 May 2019 15:31:03 +0200 (CEST) Received: by genius-map.net (Postfix, from userid 1001) id 69B2038A07F5; Thu, 2 May 2019 15:36:33 +0200 (CEST) Content-Type: text/plain; charset="iso-8859-15" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: Upgrading locale issues From: "Daniel Verite" To: "rihad" Cc: "Peter Geoghegan" ,"pgsql-general General" In-Reply-To: Date: Thu, 02 May 2019 15:36:29 +0200 Message-Id: X-Mailer: Manitou v1.7.3 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk rihad wrote: > Thanks for the reply. Do you know what would a "decent" ICU collation be= =20 > to bind to a field's schema definition so it would mimic a UTF-8=20 > encoding for a multilingual column? Maybe und-x-icu? We aren't as much=20 > concerned about their sortability in most cases, we just want indexes to= =20 > better handle future PG/ICU upgrades. But what does und(efined) even=20 > mean with respect to collations? "undefined" in this context means unspecified language and unspecified country or region. It implies that no language-specific nor regional rule will be applied to compare strings. Using C.UTF-8 as the collation for text fields to index may be the best trade-off in your case. It should be immune to libc and ICU upgrades. With C.UTF-8, a string like 'BC' will sort before 'ab', and punctuation and accents will also sort differently than with a linguistic-aware collation. If your applications care about that, it can be fixed by simply adding COLLATE "default" to the ORDER BY clause of the queries that are meant to present data to users. COLLATE "default" means the collation of the database, which presumably would be something like "language_REGION.UTF-8" in your case. If you never specified it explicitly, it came from initdb which itself got it from the environment of the server. Best regards, --=20 Daniel V=E9rit=E9 PostgreSQL-powered mailer: http://www.manitou-mail.org Twitter: @DanielVerite