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 1pfEQU-0003eU-TW for pgsql-hackers@arkaria.postgresql.org; Thu, 23 Mar 2023 06:27:55 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pfEQS-0006Hr-HH for pgsql-hackers@arkaria.postgresql.org; Thu, 23 Mar 2023 06:27:52 +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 1pfEQS-0006Gz-75 for pgsql-hackers@lists.postgresql.org; Thu, 23 Mar 2023 06:27:52 +0000 Received: from wnew4-smtp.messagingengine.com ([64.147.123.18]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pfEQP-0003dm-3T for pgsql-hackers@postgresql.org; Thu, 23 Mar 2023 06:27:51 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailnew.west.internal (Postfix) with ESMTP id 2DF252B066E5; Thu, 23 Mar 2023 02:27:47 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Thu, 23 Mar 2023 02:27:47 -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= 1679552866; x=1679560066; bh=fjxjBdhbIkDVJg9YD2nGAU0Ca5u/MJXVeYz kEiAjXbQ=; b=vTUEixm6iSDEx2cO9YHeb7q+1/18lUJh391Nckt3g2JVFaaLtjZ WF5ppZiyjWTVx8gLi47ikLo13QDaHyfEAEKyy9OV28ReYsonnHF5B3PE0IyZRd+L RGszRajnGUWcSWh+S+b71t/jyDlob2qxTaLYRrUun+xadTB4X6tbu1iZs+0WTjw0 PzPfiLltQYpKroWF3P7w4EpfaBTXlPddv4/mc+eGNEevSbTz6PlN3nCfuSgbxhVw 0my5X8ipjOllQBTa0p/+WlRM2hebrVOpb/6WkHH3UWQYjALi5pEgCI6pmo7tlnI7 kyfcPXWEcldJ+tEb0jqVmTpza2NOGcbzg1A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrvdegfedgleegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtkeertddtfeejnecuhfhrohhmpefrvght vghrucfgihhsvghnthhrrghuthcuoehpvghtvghrrdgvihhsvghnthhrrghuthesvghnth gvrhhprhhishgvuggsrdgtohhmqeenucggtffrrghtthgvrhhnpefhjeduueelfeehuedt udefteejveegieeiueejueehfeektddtueeiieeitefhveenucevlhhushhtvghrufhiii gvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehpvghtvghrrdgvihhsvghnthhrrghu thesvghnthgvrhhprhhishgvuggsrdgtohhm X-ME-Proxy: Feedback-ID: i131946ab:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 23 Mar 2023 02:27:45 -0400 (EDT) Message-ID: <7ee414ad-deb5-1144-8a0e-b34ae3b71cd5@enterprisedb.com> Date: Thu, 23 Mar 2023 07:27:43 +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> <33acfc3a772224d668042bd2cbef88e91704ce25.camel@j-davis.com> <6f32de82-88e2-480a-8421-07add8f5dee5@enterprisedb.com> <8c7af6820aed94dc7bc259d2aa7f9663518e6137.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> From: Peter Eisentraut In-Reply-To: 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 22.03.23 19:05, Jeff Davis wrote: > On Tue, 2023-03-21 at 10:35 +0100, Peter Eisentraut wrote: >> [PATCH v6 1/6] Support language tags in older ICU versions (53 and >>   earlier). >> >> In pg_import_system_collations(), this is now redundant and can be >> simplified: >> >> -               if (!pg_is_ascii(langtag) || !pg_is_ascii(iculocstr)) >> +               if (!pg_is_ascii(langtag) || !pg_is_ascii(langtag)) >> >> icu_set_collation_attributes() needs more commenting about what is >> going >> on.  My guess is that uloc_canonicalize() converts from language tag >> to >> ICU locale ID, and then the existing logic to parse that apart would >> apply.  Is that how it works? > > Fixed the redundancy, added some comments, and committed 0001. So, does uloc_canonicalize() always convert to ICU locale IDs? What if you pass a language tag, does it convert it to ICU locale ID as well? >> [PATCH v6 2/6] Wrap ICU ucol_open(). > So I'm inclined to just leave initdb alone in patches 0002 and 0003. 0002 and 0003 look ok to me now. In 0002, the error "opening default collator is not supported", should that be an assert or an elog? Is it reachable by the user? You might want to check the declarations at the top of pg_ucol_open(). 0003 reformats them after they were just added in 0002. Maybe check that they are pgindent'ed in 0002 properly. I don't understand patch 0004. It seems to do two things, handle C/POSIX locale specifications and add an SQL-callable function. Are those connected?