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 1o4kRF-0000VZ-P3 for pgsql-general@arkaria.postgresql.org; Fri, 24 Jun 2022 14:37:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1o4kQG-0004Kp-8a for pgsql-general@arkaria.postgresql.org; Fri, 24 Jun 2022 14:36:36 +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 1o4kQF-0004Kg-Uq for pgsql-general@lists.postgresql.org; Fri, 24 Jun 2022 14:36:35 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o4kQD-0006lT-Fc for pgsql-general@lists.postgresql.org; Fri, 24 Jun 2022 14:36:35 +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 25OEaSAC354890; Fri, 24 Jun 2022 10:36:28 -0400 From: Tom Lane To: Peter Eisentraut cc: Adrian Klaver , Tomas Pospisek , pgsql-general@lists.postgresql.org Subject: Re: ERROR: new collation (en_US.UTF-8) is incompatible with the collation of the template database (en_US.utf-8) In-reply-to: <1c22da3e-1b18-39b8-cecb-26777dc683f0@enterprisedb.com> References: <8c998edf-82a1-0769-77d7-7ef5076c098c@aklaver.com> <06131c03-5dd1-a8e1-37ea-65014470c22e@sourcepole.ch> <3370e253-1928-294a-facb-e9850bfefa90@aklaver.com> <589f2863-f7a8-3519-533a-f5751513823b@aklaver.com> <1c22da3e-1b18-39b8-cecb-26777dc683f0@enterprisedb.com> Comments: In-reply-to Peter Eisentraut message dated "Fri, 24 Jun 2022 13:21:45 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <354888.1656081388.1@sss.pgh.pa.us> Date: Fri, 24 Jun 2022 10:36:28 -0400 Message-ID: <354889.1656081388@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Peter Eisentraut writes: > There are also cases where on one system the locale is spelled > xx_YY.UTF8 and on another xx_YY.UTF-8. If we start adjusting for case, > should we adjust for this as well? What other cases are there? > So this would need a bit more research. Yeah. I would tend to define it as "if the locale names both end in dot followed by a recognizable encoding name, then (a) make sure that the encoding values are the same, then (b) strip off the dot and encoding before comparing the rest". We already have code to look up encoding names, and it handles all these variants. So this doesn't seem like it should take much new code, though maybe some refactoring would be needed to make the lookup code available where this check is happening. I'm not personally very excited about this, but if someone wanted to prepare a patch... regards, tom lane