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 1jao2n-0005ja-HQ for pgsql-hackers@arkaria.postgresql.org; Mon, 18 May 2020 22:15:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jao2l-00053f-1r for pgsql-hackers@arkaria.postgresql.org; Mon, 18 May 2020 22:15:31 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jao2k-00053Y-R4 for pgsql-hackers@lists.postgresql.org; Mon, 18 May 2020 22:15:30 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jao2c-0004HW-Ew for pgsql-hackers@postgresql.org; Mon, 18 May 2020 22:15:28 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id 04IMEaMw020553; Mon, 18 May 2020 18:14:36 -0400 From: Tom Lane To: Chapman Flack cc: Peter Eisentraut , Joe Nelson , pgsql-hackers@postgresql.org Subject: Re: POC: rational number type (fractions) In-reply-to: <5EC3031C.6020105@anastigmatix.net> References: <20200208042554.GE42864@begriffs.com> <0e2422da-953b-6b96-1900-f67c7e5e3307@2ndquadrant.com> <5EC3031C.6020105@anastigmatix.net> Comments: In-reply-to Chapman Flack message dated "Mon, 18 May 2020 17:50:20 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <20551.1589840076.1@sss.pgh.pa.us> Date: Mon, 18 May 2020 18:14:36 -0400 Message-ID: <20552.1589840076@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Chapman Flack writes: > On 05/18/20 17:33, Peter Eisentraut wrote: >> The numeric type already stores rational numbers. How is this different? >> What's the use? > Won't ever quite represent, say, 1/3, no matter how big you let it get. There surely are use-cases for true rational arithmetic, but I'm dubious that it belongs in core Postgres. I don't think that enough of our users would want it to justify expending core-project maintenance effort on it. So I'd be happier to see this as an out-of-core extension. (That'd also ease dealing with the prospect of having more than one variant, as was mentioned upthread.) regards, tom lane