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 1rD09i-000ZfK-RD for pgsql-bugs@arkaria.postgresql.org; Tue, 12 Dec 2023 10:38:26 +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 1rD08j-003SKX-1u for pgsql-bugs@arkaria.postgresql.org; Tue, 12 Dec 2023 10:37:25 +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 1rD08i-003SKP-MB for pgsql-bugs@lists.postgresql.org; Tue, 12 Dec 2023 10:37:24 +0000 Received: from momjian.us ([72.94.173.45]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rD08f-00A16l-QQ for pgsql-bugs@lists.postgresql.org; Tue, 12 Dec 2023 10:37:23 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=momjian.us; s=2023062407; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description; bh=fZL+g85ZJQO5oQNCvxGcF8f8yVCI6/UQN7EmeFZrEMs=; b=WBjWr ZR6zKPS35k6nBMjnJt1OddPdfkt8N4ftkGjzAoo3j3FukQ7E9NIvlSnzVjwGMQg9W5GrC7Nxrs5li gPQeqqIKdlXgJimEy1vn92jlUySQscqU/kFXJSoGzYNX3tM+jIEhrWmpm+f4OQ6dDOdWkB4FjuX7C s/xcvEPJs+SIumWCr8yFSnEVtiukEv3af8h1vDXApSfBT+7PB09WYVX6pnQViDXb7zu1SFURy/K5P 2byohRf8e7nKONey3lDa/1U6f4e5wjcwxs+8cuhqo/tTYLUGVn8zlM6x6oN6OqmMJA65Y3IeCMyLK zYwP/BZfWUHw+b9AiMa0H6xl7PeYw==; Received: from bruce by momjian.us with local (Exim 4.96) (envelope-from ) id 1rD08d-00FcvY-0I; Tue, 12 Dec 2023 05:37:19 -0500 Date: Tue, 12 Dec 2023 05:37:19 -0500 From: Bruce Momjian To: Michael Paquier Cc: Tom Lane , 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: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, Dec 12, 2023 at 10:03:43AM +0100, Michael Paquier wrote: > 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. Yes, probably. -- Bruce Momjian https://momjian.us EDB https://enterprisedb.com Only you can decide what is important to you.