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 1sXOti-003nNG-8C for pgsql-hackers@arkaria.postgresql.org; Fri, 26 Jul 2024 17:38:30 +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 1sXOtg-00FW2Y-Db for pgsql-hackers@arkaria.postgresql.org; Fri, 26 Jul 2024 17:38:28 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sXOtf-00FVyp-UY for pgsql-hackers@lists.postgresql.org; Fri, 26 Jul 2024 17:38:28 +0000 Received: from smtp.outgoing.loopia.se ([93.188.3.37]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sXOtd-001cDo-OY for pgsql-hackers@postgresql.org; Fri, 26 Jul 2024 17:38:27 +0000 Received: from s807.loopia.se (localhost [127.0.0.1]) by s807.loopia.se (Postfix) with ESMTP id 12A8E4A4C6 for ; Fri, 26 Jul 2024 19:38:24 +0200 (CEST) Received: from s980.loopia.se (unknown [172.22.191.5]) by s807.loopia.se (Postfix) with ESMTP id 041444B38D; Fri, 26 Jul 2024 19:38:24 +0200 (CEST) Received: from s471.loopia.se (unknown [172.22.191.6]) by s980.loopia.se (Postfix) with ESMTP id 01E272201613; Fri, 26 Jul 2024 19:38:24 +0200 (CEST) X-Virus-Scanned: amavisd-new at amavis.loopia.se X-Spam-Flag: NO X-Spam-Score: -1.2 X-Spam-Level: X-Spam-Status: No, score=-1.2 tagged_above=-999 required=6.2 tests=[ALL_TRUSTED=-1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1] autolearn=disabled Authentication-Results: s471.loopia.se (amavisd-new); dkim=pass (2048-bit key) header.d=proxel.se Received: from s980.loopia.se ([172.22.191.6]) by s471.loopia.se (s471.loopia.se [172.22.190.35]) (amavisd-new, port 10024) with LMTP id KjCSHgI60pBr; Fri, 26 Jul 2024 19:38:23 +0200 (CEST) X-Loopia-Auth: user X-Loopia-User: andreas@proxel.se X-Loopia-Originating-IP: 193.180.99.109 Received: from [192.168.1.132] (193.180.99.109.bredband.obe.net [193.180.99.109]) (Authenticated sender: andreas@proxel.se) by s980.loopia.se (Postfix) with ESMTPSA id 68125220162D; Fri, 26 Jul 2024 19:38:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proxel.se; s=loopiadkim1707418970; t=1722015503; bh=qihwr07BsS9UAu7kXg7b61SdcyJYoC8C22kEG8Q4gMM=; h=Date:Subject:To:References:From:In-Reply-To; b=rSj9p/4er2CPwl5ga+zD7AAn3ixgr4K6R2nq41a3sQe+GgrYTGp9hKLNcfgE8q01Q cT+o5LQCWPU99aPTqVDdmO2ov6OB5jHpA6jTGEculUgMfVPKzhmRb1mr46kBsUOAWN FQeQfzIxmrQYSOdgziM02PDl8RE+M8v9GHjdT12rfIgweRiM8vERcGGzpeCwok8Hnc s/ij4MFg6PJNsVRwVkfnVcqZkTe2x12kvERhtBart5cmzZf7KmeoDsk8Hvq6YKRwRW iBG7hdxUkQJrGeki0wJ1eKKeftuk6BS+JTr7pptzrK/RShQuXRh2RX5ge7S212C/bH 9+T7/ZJqN0Wpw== Message-ID: <468dd1fb-20f5-4213-bc70-d1388ccf28fa@proxel.se> Date: Fri, 26 Jul 2024 19:38:23 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: tiny step toward threading: reduce dependence on setlocale() To: Jeff Davis , Peter Eisentraut , pgsql-hackers@postgresql.org References: <2228884bb1f1a02614b39f71a90c94d2cc8a3a2f.camel@j-davis.com> <239b7ef6ce058c6b1c77b3a0cfcc70c1cd8968b1.camel@j-davis.com> <56af65bde2190cc5ee20c807be7b7bdcda54f40c.camel@j-davis.com> Content-Language: en-US From: Andreas Karlsson In-Reply-To: <56af65bde2190cc5ee20c807be7b7bdcda54f40c.camel@j-davis.com> 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 Nice refactoring! Two small comments about CheckMyDatabase(). - Shouldn't we look at the default_locale.ctype_is_c when setting database_ctype_is_c instead of doing a strcmp()? or maybe we should even remove the global variable and always look at the default_locale? - I think that the lookup of Anum_pg_database_datlocale could be done later in the code since it is not needed when we use a libc locale. E.g. as below. if (dbform->datlocprovider == COLLPROVIDER_LIBC) locale = collate; else { datum = SysCacheGetAttr(DATABASEOID, tup, Anum_pg_database_datlocale, &isnull); if (!isnull) locale = TextDatumGetCString(datum); } Also is there any reaosn you do not squash th 4th and the 6th patch? Andreas