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 1oatZV-0005ns-Ru for pgsql-hackers@arkaria.postgresql.org; Wed, 21 Sep 2022 06:51:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oatZU-0008OJ-Fc for pgsql-hackers@arkaria.postgresql.org; Wed, 21 Sep 2022 06:51:00 +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 1oatZU-0008O9-0N for pgsql-hackers@lists.postgresql.org; Wed, 21 Sep 2022 06:51:00 +0000 Received: from mail.postgrespro.ru ([93.174.131.139]) by magus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oatZR-0001Mo-4m for pgsql-hackers@postgresql.org; Wed, 21 Sep 2022 06:50:59 +0000 Received: from mail.postgrespro.ru (cyclops.postgrespro.ru [93.174.131.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mail.postgrespro.ru (Postfix) with ESMTPSA id 3DAF921C3D40; Wed, 21 Sep 2022 09:50:56 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mail; t=1663743056; bh=byUdew1bz1O0/sJrpHs6+tqprb4yDgKduFlnE68dSa4=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=DHiFMy5FFuAWO0lv6qaNJ4+JyeBM2/REl/B9utww6zGuVVyg076x/3oOC2PaNFsUb YyTZu0cgpS9i2Eo2sDovv47anePyVqguOcTtDTePNrAYVunp8h8aN2fEibPSyePmSC C/eCM9EF7R6wVcvi+oDXITHnCjONXT0PW3msno1o= MIME-Version: 1.0 Date: Wed, 21 Sep 2022 09:50:55 +0300 From: Marina Polyakova To: Peter Eisentraut Cc: Kyotaro Horiguchi , pgsql-hackers@postgresql.org, pryzby@telsasoft.com, rjuju123@gmail.com, daniel@manitou-mail.org, AndrewBille@gmail.com, michael@paquier.xyz Subject: Re: ICU for global collation In-Reply-To: <218b963e-dd66-626a-abd8-962afb587876@enterprisedb.com> References: <1f86f120-7b02-68f6-a434-132d054afe33@enterprisedb.com> <38d2aac40a991b20adf032e509c6eff5@postgrespro.ru> <6dd6db0984d86a51b7255ba79f111971@postgrespro.ru> <20220915.155210.529619933474389138.horikyota.ntt@gmail.com> <65ef1a8a-1fc3-3dc3-c7aa-6b9f649014b2@enterprisedb.com> <9ba4cd1ea6ed6b7b15c0ff15e6f540cd@postgrespro.ru> <218b963e-dd66-626a-abd8-962afb587876@enterprisedb.com> User-Agent: Roundcube Webmail/1.4.11 Message-ID: <36737f855bf3c44e701097cafd0ee2c9@postgrespro.ru> X-Sender: m.polyakova@postgrespro.ru Organization: Postgres Professional 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 2022-09-20 12:59, Peter Eisentraut wrote: > On 17.09.22 10:33, Marina Polyakova wrote: >> 3. >> >> The locale provider is ICU, but it has not yet been set from the >> template database: >> >>> $ initdb --locale-provider icu --icu-locale en-US -D data && >>> pg_ctl -D data -l logfile start && >>> createdb --icu-locale ru-RU --template template0 mydb >>> ... >>> createdb: error: database creation failed: ERROR:  ICU locale cannot >>> be >>> specified unless locale provider is ICU > > Please see attached patch for a fix. Does that work for you? Yes, it works. The following test checks this fix: diff --git a/src/bin/scripts/t/020_createdb.pl b/src/bin/scripts/t/020_createdb.pl index b87d8fc63b5246b02bcd4499aae815269b60df7c..c2464a99618cd7ca5616cc21121e1e4379b52baf 100644 --- a/src/bin/scripts/t/020_createdb.pl +++ b/src/bin/scripts/t/020_createdb.pl @@ -71,6 +71,14 @@ if ($ENV{with_icu} eq 'yes') $node2->command_ok( [ 'createdb', '-T', 'template0', '--locale-provider=libc', 'foobar55' ], 'create database with libc provider from template database with icu provider'); + + $node2->command_ok( + [ + 'createdb', '-T', 'template0', '--icu-locale', + 'en-US', 'foobar56' + ], + 'create database with icu locale from template database with icu provider' + ); } else { -- Marina Polyakova Postgres Professional: http://www.postgrespro.com The Russian Postgres Company