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 1pfdRe-0007FQ-Tv for pgsql-hackers@arkaria.postgresql.org; Fri, 24 Mar 2023 09:10: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 1pfdRd-0007q0-Oa for pgsql-hackers@arkaria.postgresql.org; Fri, 24 Mar 2023 09:10: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 1pfdRc-0007pr-QI for pgsql-hackers@lists.postgresql.org; Fri, 24 Mar 2023 09:10:45 +0000 Received: from new2-smtp.messagingengine.com ([66.111.4.224]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pfdRZ-0001Pd-Ko for pgsql-hackers@postgresql.org; Fri, 24 Mar 2023 09:10:43 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailnew.nyi.internal (Postfix) with ESMTP id 20EC45820F9; Fri, 24 Mar 2023 05:10:38 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Fri, 24 Mar 2023 05:10:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1679649038; x=1679656238; bh=8t9lxzLUsyCQyy3wjcUUenojCXy5qiWPeCE jkzoArNY=; b=Hmbm9sDl2h7ldeKXTmhpTDegkhiBCcCKgFoXM4T5LKMsSVToK5y opWwM65jmtDXjB2KJUPU92gBYiOVOP2u8tgRxohfMuEJ16lWNlOR7fwVjUkz6lwh jJk7NeiwwAPS8Np3cBGJkXQ+oEIOJguxrWP/pG9FrO64qMBDeGgqGXQiMJNYLeFd jOExBhTwN21vdYqFowE4Sb1jnYITMRhkr/6SSOnKu/eymMxQKsCTsPLeAcmaoYu+ tkihLxpKBFJFfk3zO/kdSAGDAiXferkFqp0uB5AUrgMGqh/x18OziPCy/+usv+4/ 2lVNp0sTw/1yDPulOxYcX6zmEmKbKTY5EDw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrvdegiecutefuodetggdotefrodftvfcurf hrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjug hrpefkffggfgfuvfevfhfhjggtgfesthejredttdefjeenucfhrhhomheprfgvthgvrhcu gfhishgvnhhtrhgruhhtuceophgvthgvrhdrvghishgvnhhtrhgruhhtsegvnhhtvghrph hrihhsvggusgdrtghomheqnecuggftrfgrthhtvghrnhepheelffeggedujeetiefhleet uddvieffhfffvdejvdffgeejkeduleduheduieefnecuvehluhhsthgvrhfuihiivgeptd enucfrrghrrghmpehmrghilhhfrhhomhepphgvthgvrhdrvghishgvnhhtrhgruhhtsegv nhhtvghrphhrihhsvggusgdrtghomh X-ME-Proxy: Feedback-ID: i131946ab:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 24 Mar 2023 05:10:37 -0400 (EDT) Message-ID: <04182066-7655-344a-b8b7-040b1b2490fb@enterprisedb.com> Date: Fri, 24 Mar 2023 10:10:35 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: ICU locale validation / canonicalization Content-Language: en-US To: Jeff Davis , Robert Haas Cc: pgsql-hackers@postgresql.org References: <11b1eeb7e7667fdd4178497aeb796c48d26e69b9.camel@j-davis.com> <4eebea80f528b1b5e381d6e834497bd6983e4e93.camel@j-davis.com> <899ab44a-4307-064f-0945-412723d57c02@enterprisedb.com> <857da8b1-2a1e-a2be-7df9-7f5e85a3bcb7@enterprisedb.com> <0d7c4115e3dd3581cec125207cbd72cab677c238.camel@j-davis.com> <1569fa4c-aded-57c4-eb07-3bcf03c5e423@enterprisedb.com> <60da0cecfb512a78b8666b31631a636215d8ce73.camel@j-davis.com> <20a2f13f652e6252531a449508e8a8be31d7664f.camel@j-davis.com> <7d77abd7767baaf30445e83415b428aa3eb54631.camel@j-davis.com> <9afa6dbe0d31053ad265aeba488fde784fd5b7ab.camel@j-davis.com> <7ee414ad-deb5-1144-8a0e-b34ae3b71cd5@enterprisedb.com> <4efdd7bdf9c811e1a32b8d10524bae8040367068.camel@j-davis.com> <6880701fd5cd5183ad7ff3a73d5c9291d6c2e331.camel@j-davis.com> From: Peter Eisentraut In-Reply-To: <6880701fd5cd5183ad7ff3a73d5c9291d6c2e331.camel@j-davis.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 24.03.23 07:39, Jeff Davis wrote: > On Thu, 2023-03-23 at 10:16 -0700, Jeff Davis wrote: >> I could get rid of the SQL-callable function and move the rest of the >> changes into 0006. I'll see if that arrangement works better, and >> that >> way we can add the SQL-callable function later (or perhaps not at all >> if it's not desired). > > Attached a new series that doesn't include the SQL-callable function. > It's probably better to just wait and see what functions seem actually > useful to users. > > I included a new small patch to fix a potential UCollator leak and make > the errors more consistent. [PATCH v8 1/4] Avoid potential UCollator leak for older ICU versions. Couldn't we do this in a simpler way by just freeing the collator before the ereport() calls. Or wrap a PG_TRY/PG_FINALLY around the whole thing? It would be nicer to not make the callers of icu_set_collation_attributes() responsible for catching and reporting the errors. [PATCH v8 2/4] initdb: emit message when using default ICU locale. I'm not able to make initdb print this message. Under what circumstances am I supposed to see this? Do you have some examples? The function check_icu_locale() has now gotten a lot more functionality than its name suggests. Maybe the part that assigns the default ICU locale should be moved up one level to setlocales(), which has a better name and does something similar for the libc locale realm. [PATCH v8 3/4] Canonicalize ICU locale names to language tags. I'm still on the fence about whether we actually want to do this, but I'm warming up to it, now that the issues with pre-54 versions are fixed. But if we do this, the documentation needs to be updated. There is a bunch of text there that says, like, you can do this format or that format, whatever you like. At least the guidance should be changed there. [PATCH v8 4/4] Validate ICU locales. I would make icu_locale_validation true by default. Or maybe it should be a log-level type option, so you can set it to error, warning, and also completely off?