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 1kEI4Z-0000D9-Pc for pgsql-hackers@arkaria.postgresql.org; Fri, 04 Sep 2020 20:12:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kEI4Y-0005AE-IM for pgsql-hackers@arkaria.postgresql.org; Fri, 04 Sep 2020 20:12:34 +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 1kEI4Y-0005A7-BG for pgsql-hackers@lists.postgresql.org; Fri, 04 Sep 2020 20:12:34 +0000 Received: from momjian.us ([72.94.173.45]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kEI4S-0007A6-3w for pgsql-hackers@lists.postgresql.org; Fri, 04 Sep 2020 20:12:33 +0000 Received: from bruce by momjian.us with local (Exim 4.92) (envelope-from ) id 1kEI4O-0003Qq-0x; Fri, 04 Sep 2020 16:12:24 -0400 Date: Fri, 4 Sep 2020 16:12:24 -0400 From: Bruce Momjian To: "David G. Johnston" Cc: Laurenz Albe , PostgreSQL Hackers Subject: Re: BUG #16419: wrong parsing BC year in to_date() function Message-ID: <20200904201224.GD6891@momjian.us> References: <16419-d8d9db0a7553f01b@postgresql.org> <0123b852ae3fe53eca11b9451d035411b06dafd5.camel@cybertec.at> <20200904012149.GA13932@momjian.us> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Fri, Sep 4, 2020 at 12:45:36PM -0700, David G. Johnston wrote: > On Thu, Sep 3, 2020 at 6:21 PM Bruce Momjian wrote: > > On Wed, Jul 15, 2020 at 09:26:53AM -0700, David G. Johnston wrote: > > > Whether to actually change the behavior of to_date is up for debate > though I > > would presume it would not be back-patched. > > OK, so, looking at this thread, we have to_date() treating -1 as -2 BC, > make_date() treating -1 as 1 BC, and we have Oracle, which to_date() is > supposed to match, making -1 as 1 BC. > > Because we already have the to_date/make_date inconsistency, and the -1 > to -2 BC mapping is confusing, and doesn't match Oracle, I think the > clean solution is to change PG 14 to treat -1 as 1 BC, and document the > incompatibility in the release notes. > > > I agree that someone else should write another patch to fix the behavior for > v14.  Still suggest committing the proposed patch to master and all supported > versions to document the existing behavior correctly.  The fix patch can work > from that. I think we need to apply the patches to all branches at the same time. I am not sure we want to document a behavior we know will change in PG 14. -- Bruce Momjian https://momjian.us EnterpriseDB https://enterprisedb.com The usefulness of a cup is in its emptiness, Bruce Lee