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 1oVDne-00071t-VG for pgsql-hackers@arkaria.postgresql.org; Mon, 05 Sep 2022 15:14:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oVDnd-00034y-5c for pgsql-hackers@arkaria.postgresql.org; Mon, 05 Sep 2022 15:14:09 +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 1oVDnc-00034n-NH for pgsql-hackers@lists.postgresql.org; Mon, 05 Sep 2022 15:14:08 +0000 Received: from mail.postgrespro.ru ([93.174.131.139]) by makus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oVDnW-0005Uo-Uy for pgsql-hackers@postgresql.org; Mon, 05 Sep 2022 15:14:07 +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 1669221C1FBA; Mon, 5 Sep 2022 18:14:00 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mail; t=1662390840; bh=GbgRvgQQ732jVHD/+2phQdJz4gfsEKtXlRopMA9hF4s=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=Dy/aBzeZV0gXmswtM2Z4fyYPulj8w10wzjiZLSsPztZjftKR3Sb3ouWIFiU+wQWIH Q3PkxJ+DrOMP8RoBKwvH5lPwFSpKeBpbLzXps8h9uerFkZFLzQsWMZ8A34xmLO5J3W ovOGwKNNLR7Gji4xLUPjyZS63gm2UMjjSZ4Sx0mo= MIME-Version: 1.0 Date: Mon, 05 Sep 2022 18:14:00 +0300 From: Marina Polyakova To: pgsql-hackers@postgresql.org Cc: Peter Eisentraut , Julien Rouhaud , Daniel Verite , pryzby@telsasoft.com, AndrewBille@gmail.com, michael@paquier.xyz Subject: Re: ICU for global collation In-Reply-To: References: <97f2c29e-24d9-3660-60cf-9138c0c47d90@enterprisedb.com> <20220628013205.GH19662@telsasoft.com> <7d74b2d7-7fc6-f55b-3f77-c0e05569b64e@enterprisedb.com> <7ad26354e75259f59c4a6c6997b8ee32@postgrespro.ru> <20220824085923.jro5ao2m5b4mdll5@jrouhaud> <13468bee-a5b4-65aa-932c-c12584f4458d@enterprisedb.com> User-Agent: Roundcube Webmail/1.4.11 Message-ID: <7c99c132dc9c0ac630e0127f032ac480@postgrespro.ru> X-Sender: m.polyakova@postgrespro.ru Organization: Postgres Professional Content-Type: multipart/mixed; boundary="=_25ae9d7f6b957002534cace820f7dfa2" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --=_25ae9d7f6b957002534cace820f7dfa2 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; format=flowed Hello! IMO after adding ICU for global collations [1] the behaviour of createdb and CREATE DATABASE is a bit inconsistent when both locale and lc_collate (or locale and lc_ctype) options are used: $ createdb mydb --locale C --lc-collate C --template template0 createdb: error: only one of --locale and --lc-collate can be specified $ psql -c "create database mydb locale = 'C' lc_collate = 'C' template = 'template0'" postgres CREATE DATABASE From the CREATE DATABASE documentation [2]: locale This is a shortcut for setting LC_COLLATE and LC_CTYPE at once. If you specify this, you cannot specify either of those parameters. The patch diff_return_back_create_database_error.patch returns back the removed code for CREATE DATABASE so it behaves like createdb as before... [1] https://github.com/postgres/postgres/commit/f2553d43060edb210b36c63187d52a632448e1d2 [2] https://www.postgresql.org/docs/devel/sql-createdatabase.html -- Marina Polyakova Postgres Professional: http://www.postgrespro.com The Russian Postgres Company --=_25ae9d7f6b957002534cace820f7dfa2 Content-Transfer-Encoding: base64 Content-Type: text/x-diff; name=diff_return_back_create_database_error.patch Content-Disposition: attachment; filename=diff_return_back_create_database_error.patch; size=727 ZGlmZiAtLWdpdCBhL3NyYy9iYWNrZW5kL2NvbW1hbmRzL2RiY29tbWFuZHMuYyBiL3NyYy9iYWNr ZW5kL2NvbW1hbmRzL2RiY29tbWFuZHMuYwppbmRleCA2ZmY0OGJiMThmMzYzOWFlNDVkOTUyOGIz MmRmNTFhNGFlYmM2MGMwLi4wYTIyY2FjZTExZDlkZjZiNWZjMDg1YmZkN2I4NjMxOWY0YjEzMTY1 IDEwMDY0NAotLS0gYS9zcmMvYmFja2VuZC9jb21tYW5kcy9kYmNvbW1hbmRzLmMKKysrIGIvc3Jj L2JhY2tlbmQvY29tbWFuZHMvZGJjb21tYW5kcy5jCkBAIC04NTEsNiArODUxLDEyIEBAIGNyZWF0 ZWRiKFBhcnNlU3RhdGUgKnBzdGF0ZSwgY29uc3QgQ3JlYXRlZGJTdG10ICpzdG10KQogCQkJCQkg cGFyc2VyX2VycnBvc2l0aW9uKHBzdGF0ZSwgZGVmZWwtPmxvY2F0aW9uKSkpOwogCX0KIAorCWlm IChkbG9jYWxlICYmIChkY29sbGF0ZSB8fCBkY3R5cGUpKQorCQllcmVwb3J0KEVSUk9SLAorCQkJ CShlcnJjb2RlKEVSUkNPREVfU1lOVEFYX0VSUk9SKSwKKwkJCQkgZXJybXNnKCJjb25mbGljdGlu ZyBvciByZWR1bmRhbnQgb3B0aW9ucyIpLAorCQkJCSBlcnJkZXRhaWwoIkxPQ0FMRSBjYW5ub3Qg YmUgc3BlY2lmaWVkIHRvZ2V0aGVyIHdpdGggTENfQ09MTEFURSBvciBMQ19DVFlQRS4iKSkpOwor CiAJaWYgKGRvd25lciAmJiBkb3duZXItPmFyZykKIAkJZGJvd25lciA9IGRlZkdldFN0cmluZyhk b3duZXIpOwogCWlmIChkdGVtcGxhdGUgJiYgZHRlbXBsYXRlLT5hcmcpCg== --=_25ae9d7f6b957002534cace820f7dfa2--