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 1nVQUk-0001SF-2l for pgsql-hackers@arkaria.postgresql.org; Sat, 19 Mar 2022 04:15:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nVQUh-0006CP-Vz for pgsql-hackers@arkaria.postgresql.org; Sat, 19 Mar 2022 04:15:11 +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 1nVQUh-0006C4-JZ for pgsql-hackers@lists.postgresql.org; Sat, 19 Mar 2022 04:15:11 +0000 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nVQUe-0003lX-Hz for pgsql-hackers@lists.postgresql.org; Sat, 19 Mar 2022 04:15:11 +0000 Received: by mail-pl1-x62b.google.com with SMTP id h5so8594859plf.7 for ; Fri, 18 Mar 2022 21:15:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=Ap3za65FE+HS/HU2IeNxY5NJvhRRR6RWgnHYmbcxrng=; b=oJYbCYmRuzIJFIl+XtsYn+vCMWDPXooMvqH4B2Kalgshmo4Q6Jks0Yn3qx2gBg36Zo ndQLNLpAnKqUs/2XKl4ATK2QvHsi/HDDAV6EcLImO+3FtUOiIFBIlxitCXOVHFAr5NCr 8sQBXY5gu/YBqPKTiaaXz74yQS9HvP9GP8DE6ZYOh6w6WUugO5TPXJK3PtRRtTCUoVTc JkOkHtn7DaoMVuoEYoOwhqF/iDZl3aoK7vasSpyE4rUsK+5TkhTLhcOztLgdNsfSCBu1 H01d1D9HNX9GuOE5vNozM5U4ZTy5VcKANP7TbmZ7Aaj3vWWjEEDgeMEmflMnCCoHZ1PE RZeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=Ap3za65FE+HS/HU2IeNxY5NJvhRRR6RWgnHYmbcxrng=; b=Y3fRcfxy4RtQQQlF3UlZUxm6X6XlulLJOee8+EQ8ZN0UUahc6ILm1jxzww6PSFIXp+ JieFxuvxnV4Ya90ZaEFL+5UfqUnYNSw2CMluLs+CKe/MoNAIKkvbN5G5QEFbXNKzc5pp NoqbmFYOPHF+21q/XTvF+GnbUkBTzwXMCQx3AabLYmJgClItwpv2v023WOqcoN5G5ban WxUkSlYdJkaNqlZVROB+pnJl/8N7W6dUg2e0wZijdG/Eeis1KIY4lxkXGccyO7G8bs0J lJGPI8gn8c92TqdpG29lSwD12eZf83HrLpMUMe6GXQNaaQqqOiN569TiHW5HwGrwZ3iH cWuA== X-Gm-Message-State: AOAM532xVCJIBWc/ZEMJSRou2F9t5AcneOEv83EnrgnH+2Pr4X5eSn0V lERQhYqprV5BX1pqfXcZPS4= X-Google-Smtp-Source: ABdhPJxKlQACtDWOlhF/WnE8tb215up3mQgo2AO8pTi/e9taqD6Y85UXtQStY3pgRFJO1j3ISwx2ng== X-Received: by 2002:a17:902:e84c:b0:153:fedf:518 with SMTP id t12-20020a170902e84c00b00153fedf0518mr2738288plg.103.1647663305343; Fri, 18 Mar 2022 21:15:05 -0700 (PDT) Received: from jrouhaud (2001-b011-1005-9591-6d65-b63f-567b-ff92.dynamic-ip6.hinet.net. [2001:b011:1005:9591:6d65:b63f:567b:ff92]) by smtp.gmail.com with ESMTPSA id lb4-20020a17090b4a4400b001b9b20eabc4sm10581977pjb.5.2022.03.18.21.15.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Mar 2022 21:15:04 -0700 (PDT) Date: Sat, 19 Mar 2022 12:14:59 +0800 From: Julien Rouhaud To: Andres Freund Cc: Peter Eisentraut , Thomas Munro , Michael Paquier , pgsql-hackers@lists.postgresql.org Subject: Re: pgsql: Add option to use ICU as global locale provider Message-ID: <20220319041459.qqqiqh335sga5ezj@jrouhaud> References: <20220318031244.tu3wwlyxxabzq3iu@jrouhaud> <20220318063648.4ja6rxlyzvc3viio@jrouhaud> <20220318074051.n46mkwp2zkbxeesf@jrouhaud> <20220318092749.363m4uv6rq24lctz@jrouhaud> <7960418a-b5ac-8a53-bf45-dec2b48e01e9@enterprisedb.com> <20220318220959.pc4hpdmat6gbcdc2@alap3.anarazel.de> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="pzaifvl6dybqyz3b" Content-Disposition: inline In-Reply-To: <20220318220959.pc4hpdmat6gbcdc2@alap3.anarazel.de> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --pzaifvl6dybqyz3b Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Mar 18, 2022 at 03:09:59PM -0700, Andres Freund wrote: > Hi, > > On 2022-03-18 20:28:58 +0100, Peter Eisentraut wrote: > > Why does your patch introduce a function check_icu_locale() that is only > > called once? Did you have further plans for that? > > I like that it moves ICU code out of dbcommands.c Yes, it seemed cleaner this way. But more importantly code outside pg_locale.c really shouldn't have to deal with ICU specific version code. I'm attaching a v2, addressing Peter and Tom comments to not duplicate the old ICU versions attribute function. I removed the ICU locale check entirely (for consistency across ICU version) thus removing any need for ucol.h include in initdb. For the problem you reported at [1] with the meson branch, I changed createdb tests with s/en-u-kf-upper/en@colCaseFirst=upper/, as older ICU versions don't understand the former notation. check-world now pass for me, using either ICU < 54 or >= 54. > imo there should be few > calls to ICU functions outside of pg_locale.c. There might be an argument for > moving *more* into such a function though. I think it would be a good improvement. I can work on that next week if needed. [1] https://www.postgresql.org/message-id/20220318000140.vzri3qw3p4aebn5p@alap3.anarazel.de --pzaifvl6dybqyz3b Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="v2-0001-Fix-global-icu-collations-for-ICU-54.patch"