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 1n4mHb-00054u-U0 for pgsql-hackers@arkaria.postgresql.org; Tue, 04 Jan 2022 16:03:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1n4mHa-00058Z-Dt for pgsql-hackers@arkaria.postgresql.org; Tue, 04 Jan 2022 16:03:30 +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 1n4mHY-00058M-TK for pgsql-hackers@lists.postgresql.org; Tue, 04 Jan 2022 16:03:30 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1n4mHU-0007Bl-3L for pgsql-hackers@postgresql.org; Tue, 04 Jan 2022 16:03:28 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 9599D5C0112; Tue, 4 Jan 2022 11:03:20 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Tue, 04 Jan 2022 11:03:20 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=k76WREJaBpxcumyIxOyWogNVa+elNZkwFRxeydpII Ys=; b=Xx3xb7SerSP0KEGkKLT/Kr8ZTW0D0P01Ps+NlbvQzsXdIgPWKN7au+Yhq iDYSdC9pZgw5nV6PIkDKQ2EOujxegyxGoKMXNGyWm6RVlLOf85n3mHvqThvjsYrl rnTuHudJP5Qe/craGRqAj/Qa4q65CuWYeApZnnWgw+f8tNSjYKYQoee7fI/SojoB A+FYwBO0rtAWsXatRPHyAn6hfemO/IQhdbBroewZ5PX+/jfuhm8Wznfo1paf1AOv enbvGlmdTSBP5IdufbKgLPGaaL4TksHWuBZ1yxZi7n7fOmBbyua5lidk7xGSlgwe Hll/NiNNjv+6DAG8odg5XPauD9C9g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrudeffedgkeefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvfhfhjggtgfesthejredttdefjeenucfhrhhomheprfgvthgv rhcugfhishgvnhhtrhgruhhtuceophgvthgvrhdrvghishgvnhhtrhgruhhtsegvnhhtvg hrphhrihhsvggusgdrtghomheqnecuggftrfgrthhtvghrnhepfeejgeehteeuhfevvedu leeufedtjeetiefftedvudfhtdeifefgueettdevgefgnecuvehluhhsthgvrhfuihiivg eptdenucfrrghrrghmpehmrghilhhfrhhomhepphgvthgvrhdrvghishgvnhhtrhgruhht segvnhhtvghrphhrihhsvggusgdrtghomh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 4 Jan 2022 11:03:11 -0500 (EST) Message-ID: Date: Tue, 4 Jan 2022 17:03:10 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.4.1 Subject: Re: ICU for global collation Content-Language: en-US To: Julien Rouhaud Cc: pgsql-hackers , Daniel Verite References: <374f8048-9d87-462c-a8aa-d02ffca6525f@manitou-mail.org> <525ef44f-52bf-505f-a491-07835d039424@enterprisedb.com> From: Peter Eisentraut In-Reply-To: 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 04.01.22 03:21, Julien Rouhaud wrote: >> @@ -2774,6 +2776,7 @@ dumpDatabase(Archive *fout) >> appendPQExpBuffer(dbQry, "SELECT tableoid, oid, datname, " >> "(%s datdba) AS dba, " >> "pg_encoding_to_char(encoding) AS encoding, " >> + "datcollprovider, " > > This needs to be in a new pg 15+ branch, not in the pg 9.3+. ok >> - if (!lc_collate_is_c(collid) && collid != DEFAULT_COLLATION_OID) >> - mylocale = pg_newlocale_from_collation(collid); >> + if (!lc_collate_is_c(collid)) >> + { >> + if (collid != DEFAULT_COLLATION_OID) >> + mylocale = pg_newlocale_from_collation(collid); >> + else if (default_locale.provider == COLLPROVIDER_ICU) >> + mylocale = &default_locale; >> + } > > There are really a lot of places with this new code. Maybe it could be some > new function/macro to wrap that for the normal case (e.g. not formatting.c)? Right, we could just put this into pg_newlocale_from_collation(), but the comment there says * In fact, they shouldn't call this function at all when they are dealing * with the default locale. That can save quite a bit in hotspots. I don't know how to assess that. We could pack this into a macro or inline function if we are concerned about this.