Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rzCOI-002Ri3-R3 for pgsql-committers@arkaria.postgresql.org; Tue, 23 Apr 2024 09:24:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rzCNJ-007SyZ-0d for pgsql-committers@arkaria.postgresql.org; Tue, 23 Apr 2024 09:23:41 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rzCNI-007SyQ-Pt for pgsql-committers@lists.postgresql.org; Tue, 23 Apr 2024 09:23:40 +0000 Received: from fout8-smtp.messagingengine.com ([103.168.172.151]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rzCNG-004E5E-AZ for pgsql-committers@lists.postgresql.org; Tue, 23 Apr 2024 09:23:39 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailfout.nyi.internal (Postfix) with ESMTP id 8200313813FF; Tue, 23 Apr 2024 05:23:37 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Tue, 23 Apr 2024 05:23:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eisentraut.org; h=cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1713864217; x=1713950617; bh=atDE7hHOlSFRgSwmUp7zWNKsq5xptblxfLD0p5O9s5E=; b= grNCEsJyaZ+ETeznAgq5FpEfbenW+NyeDn0wEgWkZsVFzKGte+YYXL66dWBvoFR2 5gd5HO8T6EUPIeTEp5oSxM3+3maQ52ihKlIvoVe1CRLP3k8paodoMt37pKlUB/Md s9htT7qiLf70VNgez/XgIe21r+qyUPL5OMUGJXj5OhY8V6bioPFDh+6GVSST5ccV hDF5eIEGV/6oOe0f0HcC0Q7M1HPWS0By+89dq4jQLj+J33uQzneWYnPpvRTSKrVA T4OAQi1RSUE6/Nd/eYLukK9aEFewwryNlDwGok0XfiOipZGV4rGAhUFSJXhYWmDT 6nbWdmKU3R9ck4zW+tSp7g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=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:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1713864217; x= 1713950617; bh=atDE7hHOlSFRgSwmUp7zWNKsq5xptblxfLD0p5O9s5E=; b=U bTxZZenu5YmD9AR2rwnW5I5epzWjpTttxktNMn9rsBQuLzuF0bj84AITUbGTWI5k j47G8ztzWPEp0s4Sp3u9wz8/7WJBzuJ7SOYH2U/+zyh5+Nopc509bHqhH1iCkJ0Q 1NLRAEh5nYkHJ+cPdQVs6AHss4soCbM2L4BHwa3NC0/lly2pvDuwF2u8VO8VY/F6 dTchtd2JCQIRDw3wgA/VALrmMtmc4FQH1C82xXxG8b4HeEry7Vv60UzOe2AfwviY +V5agr3wjlZ+0ikbNZEsicLclHW0AKg8eqze7d1Uk06x7m8n/AybC+6ifDffE7AA PpABod3Db4qR9sN4GHSJA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrudeluddgudegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvfhfhjggtgfesthejredttddvjeenucfhrhhomheprfgvthgv rhcugfhishgvnhhtrhgruhhtuceophgvthgvrhesvghishgvnhhtrhgruhhtrdhorhhgqe enucggtffrrghtthgvrhhnpeehiedvhfeuhfeugefgfeehgeejtdevuefhtefhueefvddu gfdtueehgfefudfhffenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrih hlfhhrohhmpehpvghtvghrsegvihhsvghnthhrrghuthdrohhrgh X-ME-Proxy: Feedback-ID: ie0a040ee:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 23 Apr 2024 05:23:36 -0400 (EDT) Message-ID: <4ea13583-7305-40b0-8525-58381533e2b1@eisentraut.org> Date: Tue, 23 Apr 2024 11:23:35 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: pgsql: Introduce "builtin" collation provider. To: Jeff Davis , pgsql-committers@lists.postgresql.org References: Content-Language: en-US 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 14.03.24 07:39, Jeff Davis wrote: > Introduce "builtin" collation provider. Jeff, I think I found a small bug in this commit. The new code in dbcommands.c createdb() reads like this: + /* validate provider-specific parameters */ + if (dblocprovider != COLLPROVIDER_BUILTIN) + { + if (dbuiltinlocale) + ereport(ERROR, + (errcode(ERRCODE_INVALID_OBJECT_DEFINITION), + errmsg("BUILTIN_LOCALE cannot be specified unless locale provider is builtin"))); + } + else if (dblocprovider != COLLPROVIDER_ICU) + { + if (diculocale) + ereport(ERROR, + (errcode(ERRCODE_INVALID_OBJECT_DEFINITION), + errmsg("ICU locale cannot be specified unless locale provider is ICU"))); + + if (dbicurules) + ereport(ERROR, + (errcode(ERRCODE_INVALID_OBJECT_DEFINITION), + errmsg("ICU rules cannot be specified unless locale provider is ICU"))); + } But if dblocprovider is COLLPROVIDER_LIBC, then the first "if" is true and the second one won't be checked. I think the correct code structure would be to make both of these checks separate if statements.