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 1rCygJ-000VcE-72 for pgsql-bugs@arkaria.postgresql.org; Tue, 12 Dec 2023 09:03:59 +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 1rCygH-002jeB-QX for pgsql-bugs@arkaria.postgresql.org; Tue, 12 Dec 2023 09:03:57 +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 1rCygH-002je3-HW for pgsql-bugs@lists.postgresql.org; Tue, 12 Dec 2023 09:03:57 +0000 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rCygA-00BXgy-Gn for pgsql-bugs@lists.postgresql.org; Tue, 12 Dec 2023 09:03:56 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id C7F3B3200A55; Tue, 12 Dec 2023 04:03:46 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Tue, 12 Dec 2023 04:03:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc: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=fm1; t=1702371826; x=1702458226; bh=NeSvs8TatY 35aCFSoEO8VXgQS8bPEsuzjjhvfx1T0mE=; b=mH3Hv8WUS3FpTUhb89DYs1fVNr AHvHhMZawfisXj7F2Ddf5bNJq3h8pFS3P/s3InSQTHHfAmO9l/6wI/nEW1d7aKlI pjWk6i8aYm/0hBXzW39jXwmqcbE8ZChsBD/qxaj1YFWZUUN7oEAmg5Zc/7NqDKKM Kc+hl45KEyr721Cf5Qglwl5xBZ1XRmzr0KgK+8GWVvBk6yXXsCQTC5SLMXmnEii6 ye6iIsRMa9Vcv/KEQ0eOsQd3NQDIyvF9jJKN/o8FXjUildV+QIVDF2UVeFVfIDdo cqlGn/1fPUZrJMPgnxAmyO+TRuuDKc5J16ojX37CRosha/A+K4CxQ8IrOKrA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc: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= fm1; t=1702371826; x=1702458226; bh=NeSvs8TatY35aCFSoEO8VXgQS8bP Esuzjjhvfx1T0mE=; b=JCaWUTEyj8a5xJ2CQf3g/RtGg2eS6XLLjiUOmENK0SZc PfZrjntPbTZruk16CupL7pHeK3gsZdRVVpO4yx7Uxmw9TEqugeALSaBJBJV/DlT8 oGNV0aKXwKkWCWy7ILoeb5qWHeqsTM4mWSB70IdVygqYp14k3lKhKcYRmdESBerU aGqkVDoe7ZrcPcRhV16QoyozQB8r3RzPm4zeVxfwLL3BQ+nvfk6ot2immLVXUYqu dq95mz7mxNKC0LtbyK8tMv4SQXpvtEgxP7FKIImKcd5r4Kri75++QVTIqM2UBtFC dhX/94+KNV7GHA77+WIWQIxO0b5ab6RuUXUPEABnVA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrudelfedguddvlecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecufghrlhcuvffnffculdefhedmnecujfgurhepff fhvfevuffkfhggtggujgesghdtreertddtvdenucfhrhhomhepofhitghhrggvlhcurfgr qhhuihgvrhcuoehmihgthhgrvghlsehprghquhhivghrrdighiiiqeenucggtffrrghtth gvrhhnpeegffejvefgveduvdejtddvtdeijeehudeuledvudeftdfgfeejvdekveekiedv vdenucffohhmrghinhepphhoshhtghhrvghsqhhlrdhorhhgnecuvehluhhsthgvrhfuih iivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmhhitghhrggvlhesphgrqhhuihgv rhdrgiihii X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 12 Dec 2023 04:03:45 -0500 (EST) Date: Tue, 12 Dec 2023 10:03:43 +0100 From: Michael Paquier To: Tom Lane Cc: exclusion@gmail.com, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #18240: Undefined behaviour in cash_mul_flt8() and friends Message-ID: References: <18240-c5da758d7dc1ecf0@postgresql.org> <2171714.1702307153@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="bsc2wVZHjdfGHuxq" Content-Disposition: inline In-Reply-To: <2171714.1702307153@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --bsc2wVZHjdfGHuxq Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Dec 11, 2023 at 10:05:53AM -0500, Tom Lane wrote: > Yeah, approximately none of cash.c pays any attention to the risks > of overflow/underflow. Improving that situation would be a good > finger exercise for some aspiring hacker, perhaps. Although I bet > somebody will ask again why it is that we continue to support the > money type. AFAIK, we discourage the use of money in the wiki for quite a few years: https://wiki.postgresql.org/wiki/Don%27t_Do_This#Don.27t_use_money And numeric has much better code coverage and support. I am wondering whether we've reached the point where it would be better to remove it entirely from the tree, and just tell people to use numeric. This has a cost for upgrades, where we should cross check for its use but there is already check_for_data_type_usage() to do this job so the facility is there. -- Michael --bsc2wVZHjdfGHuxq Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmV4Ie8ACgkQnvQgOdby QH2rdRAAmso4GlweWTBjBgLqi++y4+R23J3xjbYx7m5TFYDVY1UZ+raSRXfufzkw TdV3j2MZkFomC/3WEYg+J09rDPPK2gn1WYm4o50F9YM9/BUeu1DBIvrbZLZ9aY1u g/HxIHX8LUxyoRgT7SgvYteT4p0m5OA6jakYJdpe8TNhSAKQ7YjCpLiaaVOCqCI8 yETZ21C+KImIk6ZBUD4i53xl2oRUmWri293xSG/fyUf6IBmPFgNnFNPSQU5CO5nP MJwMPtj8Ghy5t88hKdP5ARz+0mcFpKqvNFr8mr1idVatUXkEK7gVatzbTAO0m8ru m6VmjA5MmeMbq2Fs8GLGPZrwxl4GfVcHe2HcGimFsACSqe9lGNgjnNu11PD74zE7 OErBy8kHULYgbPq3fzA+1oQ95mfPiigIaAKHKDmHHAgyco8sVQ6KHi4/p5EwbH8D u7Xu1EL7UIxL3vFbc+P7ErBktDD/IbLlMJK2UZr6H0BGEkfno+t1c87R2oJZYxzd HuVjCc1uCfLNKvGNIuT0E3PW9blLMsC7myJ1HRS64MCebyCYoWJpSzU8fF2G/j1g n94LeUfu4yB1VhFAem+rE4YOw1NI9NHgrHVe4uv527eq5WDgywRFjjbRRRq+0I0C QEoaMZITn9NF+r+Feg1rcpLT5wDOG0yAdFNF7pyrIbneu/fBJHE= =krti -----END PGP SIGNATURE----- --bsc2wVZHjdfGHuxq--