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 1q2cT2-0000QF-19 for pgsql-hackers@arkaria.postgresql.org; Fri, 26 May 2023 18:47:12 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1q2cT0-0007VK-O9 for pgsql-hackers@arkaria.postgresql.org; Fri, 26 May 2023 18:47:10 +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 1q2cT0-0007VA-Bq for pgsql-hackers@lists.postgresql.org; Fri, 26 May 2023 18:47:10 +0000 Received: from mail-pf1-x430.google.com ([2607:f8b0:4864:20::430]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1q2cSv-002Klf-Pe for pgsql-hackers@lists.postgresql.org; Fri, 26 May 2023 18:47:09 +0000 Received: by mail-pf1-x430.google.com with SMTP id d2e1a72fcca58-64d30ab1f89so939799b3a.3 for ; Fri, 26 May 2023 11:47:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=j-davis-com.20221208.gappssmtp.com; s=20221208; t=1685126824; x=1687718824; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=qAXCwzuMDp+Ieqx0CVsXIaXkMoiV+/EfTNBszJB5RTA=; b=4L2AFdjefkv2qz9gahPoLBGFVqOmAP0u7uFEizVI4AZHjdVItW0K7ptv3gUjxjdT5Z 9tBkO9T5x3VpjPTmzQ4Jk68tvX9nZtiMtcdNIoAESqvfM9BvKTBYCXJcS1lqtsuhu4pG lT5gBhhBKRtvq/BKe5hOK5zU4osd8ieOSrIR98RaQWgK+T9XQ1Mf46qT8SLvaUZNCLvO X2a2YC1NuNr5ujHPe82r7ifUQDnAlbGA2zxyx8Wc5bhlHXMLSJJSHeDQUE1IGfiKHEkh 3tYrw08othg9dTUWcZgAv2AbeRrbDJ4hFyKFkcEwcL8lLu+6Ci88mP/Wa89ysB3Ilqxd tjjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685126824; x=1687718824; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=qAXCwzuMDp+Ieqx0CVsXIaXkMoiV+/EfTNBszJB5RTA=; b=PkNRDSpOFCvsJkWPubbGMlrq9YlkMp/jFnmppEMOqxYMhcMvIz7ULJw8bWTAEfOBVI lsOja0bf4XGxRF4gbmT9IDK/HT6cdGzmKXVsoJwYNWrWQ68kE/wU4+4Cjjb2pvAIzJdA 5cCHj7xxLiifGS5SlibYC9u3cj9npVxTuZm42OLoU/ya3YboWP/Hqk+tZnJmQG6yXTpj lmmJnBeh5lubfVO4ERx5ohpVsGWAGHKl4f844FwW3iaiO8qGQiQXkolLdZdByel5Xw0p ZKABzHPA2+gU+g2rgzpo9LkJoiez+p3qE4g/BnpdLctKnKsWtqFz+nvyL3ZJgm+orad6 fuaQ== X-Gm-Message-State: AC+VfDyAkVXBFxGNvsqRvZ2VCE/HfiY/WsGSZUGg7eo4BdE7KdE1dueW pHpGEfxAJrJMC+m5LVe4NyavyA== X-Google-Smtp-Source: ACHHUZ6tzrVnP9WejyhQj81xyOIH0R4SMdmoYchNN4M5H+meoeR0GnGFB0G6/HqsoNVb2PKOUcUb4Q== X-Received: by 2002:a05:6a20:1453:b0:101:282c:2b with SMTP id a19-20020a056a20145300b00101282c002bmr320806pzi.32.1685126824299; Fri, 26 May 2023 11:47:04 -0700 (PDT) Received: from jeff-laptop.lan (c-73-170-46-202.hsd1.ca.comcast.net. [73.170.46.202]) by smtp.gmail.com with ESMTPSA id ls3-20020a17090b350300b0024e11f7a002sm3173299pjb.15.2023.05.26.11.47.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 May 2023 11:47:03 -0700 (PDT) Message-ID: <019ee93d8e7052b3a98fb46165e6c96fe312f338.camel@j-davis.com> Subject: Re: Order changes in PG16 since ICU introduction From: Jeff Davis To: Daniel Verite Cc: Matthias van de Meent , Andrew Gierth , Peter Eisentraut , Sandro Santilli , Tom Lane , Regina Obe , pgsql-hackers@lists.postgresql.org Date: Fri, 26 May 2023 11:47:02 -0700 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.4-0ubuntu1 MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, 2023-05-26 at 18:24 +0200, Daniel Verite wrote: > To me initdb is wrong when coming up with the less precise "fr" > instead of "fr-FR". >=20 > I suggest the attached patch to call uloc_getDefault() instead of the > current code that somehow leaves out the country/region component. Thank you. I experimented with several ICU versions and different environmental settings, and it does seem better at preserving the name that comes from the environment. There is a warning in the docs: "Do not use unless you know what you are doing."[1] I don't see a reason for the warning or any major risk from us using it. Perhaps it's because the result is affected by either the environment or the last uloc_setDefault() call. We don't use uloc_setDefault(), and we only call uloc_getDefault() once, so I don't see a risk here. The fix seems simple enough. Committed. Regards, Jeff Davis [1] https://unicode-org.github.io/icu-docs/apidoc/dev/icu4c/uloc_8h.html#a4efa1= 6db7351e62293f8ef0c37aac8d2