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 1oXllX-000417-UM for pgsql-general@arkaria.postgresql.org; Mon, 12 Sep 2022 15:54:31 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oXlkX-0000dG-2H for pgsql-general@arkaria.postgresql.org; Mon, 12 Sep 2022 15:53:29 +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 1oXlkW-0000d7-OJ for pgsql-general@lists.postgresql.org; Mon, 12 Sep 2022 15:53:28 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oXlkU-00020v-Hp for pgsql-general@lists.postgresql.org; Mon, 12 Sep 2022 15:53:27 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 28CFrPvu1655013; Mon, 12 Sep 2022 11:53:25 -0400 From: Tom Lane To: Simon Riggs cc: "Watzinger, Alexander" , "pgsql-general@lists.postgresql.org" Subject: Re: Support for dates before 4713 BC In-reply-to: References: <4161384.1661105052@sss.pgh.pa.us> <1622177.1662994813@sss.pgh.pa.us> Comments: In-reply-to Simon Riggs message dated "Mon, 12 Sep 2022 16:41:19 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1655011.1662998005.1@sss.pgh.pa.us> Date: Mon, 12 Sep 2022 11:53:25 -0400 Message-ID: <1655012.1662998005@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Simon Riggs writes: > On Mon, 12 Sept 2022 at 16:00, Tom Lane wrote: >> No, it applies because we aren't sure that the math would operate >> correctly with negative Julian day numbers --- for instance, division >> roundoffs might happen in the wrong direction. If somebody wanted to go >> through and check/fix all that, we could probably relax the restriction. > OK, challenge seems clear. FWIW, I think this decision dates to a time when we still worried about C89's lack of specificity about which direction integer division will round negative results in. Now that we're targeting only C99-compliant platforms, that part should be easier. regards, tom lane