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 1p879f-0002Mx-Me for pgsql-hackers@arkaria.postgresql.org; Wed, 21 Dec 2022 22:01:39 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1p879e-0006wd-KG for pgsql-hackers@arkaria.postgresql.org; Wed, 21 Dec 2022 22:01:38 +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 1p879e-0006wU-Bh for pgsql-hackers@lists.postgresql.org; Wed, 21 Dec 2022 22:01:38 +0000 Received: from relay11.mail.gandi.net ([217.70.178.231]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p879b-0003aM-QX for pgsql-hackers@lists.postgresql.org; Wed, 21 Dec 2022 22:01:37 +0000 Received: (Authenticated sender: adsend@dunslane.net) by mail.gandi.net (Postfix) with ESMTPSA id 38FDB100003; Wed, 21 Dec 2022 22:01:31 +0000 (UTC) Message-ID: Date: Wed, 21 Dec 2022 17:01:30 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: float4in_internal Content-Language: en-US To: Tom Lane Cc: PostgreSQL Hackers References: <1352557.1671636815@sss.pgh.pa.us> From: Andrew Dunstan In-Reply-To: <1352557.1671636815@sss.pgh.pa.us> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2022-12-21 We 10:33, Tom Lane wrote: > Andrew Dunstan writes: >> The attached patch factors out the guts of float4in so that the new >> float4in_internal function is callable without going through the fmgr >> call sequence. This will make adjusting the seg module's input function >> to handle soft errors simpler. A similar operation was done for float8in >> some years ago in commit 50861cd683e. The new function has an identical >> argument structure to float8in_internal. > Looks reasonable except for one nitpick: the "out of range" message > in the ERANGE case should be kept mentioning real, not the passed > type_name, to be equivalent to the way float8in_internal does it. > I lack enough caffeine to recall exactly why float8in_internal > does it that way, but the comments are exceedingly clear that it was > intentional, and I'm sure the same rationale would apply here. > > (float8in_internal also goes out of its way to show just the part of > the string that is the number in that case, but I'm willing to let > that pass for now.) > > Thanks for reviewing. I made both these changes, to keep the two functions more closely aligned. cheers andrew -- Andrew Dunstan EDB: https://www.enterprisedb.com