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 1pXWSB-0004E3-Vl for pgsql-hackers@arkaria.postgresql.org; Thu, 02 Mar 2023 00:05: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 1pXWS9-0000zx-Tj for pgsql-hackers@arkaria.postgresql.org; Thu, 02 Mar 2023 00:05:45 +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 1pXWS9-0000zn-K0 for pgsql-hackers@lists.postgresql.org; Thu, 02 Mar 2023 00:05:45 +0000 Received: from relay7-d.mail.gandi.net ([2001:4b98:dc4:8::227]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pXWS4-0002Ym-Vs for pgsql-hackers@postgresql.org; Thu, 02 Mar 2023 00:05:44 +0000 Received: (Authenticated sender: vik@postgresfriends.org) by mail.gandi.net (Postfix) with ESMTPSA id 3980720004; Thu, 2 Mar 2023 00:05:34 +0000 (UTC) Message-ID: <630e4ed7-fc2b-e7cb-d67c-7d2a28391245@postgresfriends.org> Date: Thu, 2 Mar 2023 01:05:34 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Subject: Re: Add standard collation UNICODE To: Peter Eisentraut , pgsql-hackers References: <1293e382-2093-a2bf-a397-c04e8f83d3c2@enterprisedb.com> From: Vik Fearing Content-Language: en-US In-Reply-To: <1293e382-2093-a2bf-a397-c04e8f83d3c2@enterprisedb.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 3/1/23 11:09, Peter Eisentraut wrote: > The SQL standard defines several standard collations.  Most of them are > only of legacy interest (IMO), but two are currently relevant: UNICODE > and UCS_BASIC.  UNICODE sorts by the default Unicode collation algorithm > specifications and UCS_BASIC sorts by codepoint. > > When collation support was added to PostgreSQL, we added UCS_BASIC, > since that could easily be mapped to the C locale.  But there was no > straightforward way to provide the UNICODE collation.  (Recall that > collation support came several releases before ICU support.) > > With ICU support, we can provide the UNICODE collation, since it's just > the root locale.  I suppose one hesitation was that ICU was not a > standard feature, so this would create variations in the default catalog > contents, or something like that.  But I think now that we are drifting > to make ICU more prominent, we can just add that anyway.  I think being > able to say > >     COLLATE UNICODE > > instead of > >     COLLATE "und-x-icu" > > or whatever it is, is pretty useful. > > So, attached is a small patch to add this. I don't feel competent to review the patch (simple as it is), but +1 on the principle. -- Vik Fearing