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.96) (envelope-from ) id 1wFpAN-005asa-0e for pgsql-bugs@arkaria.postgresql.org; Thu, 23 Apr 2026 08:12:07 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wFpAM-000fVJ-1h for pgsql-bugs@arkaria.postgresql.org; Thu, 23 Apr 2026 08:12:06 +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.96) (envelope-from ) id 1wFpAM-000fVA-0r for pgsql-bugs@lists.postgresql.org; Thu, 23 Apr 2026 08:12:06 +0000 Received: from smtp.outgoing.loopia.se ([93.188.3.37]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wFpAG-00000002Nw4-36Ms for pgsql-bugs@lists.postgresql.org; Thu, 23 Apr 2026 08:12:05 +0000 Received: from s807.loopia.se (localhost [127.0.0.1]) by s807.loopia.se (Postfix) with ESMTP id 6CC1859C4D9 for ; Thu, 23 Apr 2026 10:11:58 +0200 (CEST) Received: from s979.loopia.se (unknown [172.22.191.5]) by s807.loopia.se (Postfix) with ESMTP id 5C47659CCD3; Thu, 23 Apr 2026 10:11:58 +0200 (CEST) Received: from localhost (unknown [172.22.191.5]) by s979.loopia.se (Postfix) with ESMTP id 5894710BC441; Thu, 23 Apr 2026 10:11:58 +0200 (CEST) X-Virus-Scanned: amavis at amavis.loopia.se X-Spam-Flag: NO X-Spam-Score: -1.2 X-Spam-Level: X-Spam-Status: No, score=-1.2 tagged_above=-999 required=6.2 tests=[ALL_TRUSTED=-1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1] autolearn=disabled Authentication-Results: s472.loopia.se (amavis); dkim=pass (2048-bit key) header.d=yesql.se Received: from s979.loopia.se ([172.22.191.5]) by localhost (s472.loopia.se [172.22.190.12]) (amavis, port 10024) with UTF8LMTP id 1PZpvQbHEiO6; Thu, 23 Apr 2026 10:11:57 +0200 (CEST) X-Loopia-Auth: user X-Loopia-User: daniel@yesql.se X-Loopia-Originating-IP: 89.255.232.236 Received: from smtpclient.apple (customer-89-255-232-236.stosn.net [89.255.232.236]) (Authenticated sender: daniel@yesql.se) by s979.loopia.se (Postfix) with ESMTPSA id B23B910BC47E; Thu, 23 Apr 2026 10:11:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yesql.se; s=loopiadkim1707475645; t=1776931917; bh=apoTLNuvt3LdJ0zx9u9D8lY5apCQikvpAVkEU1/pWH4=; h=Subject:From:In-Reply-To:Date:Cc:References:To; b=WWwbaloKRlwZYNqUgwarkPqiqywQ1ua4UFuwPQP4kG+FvhmyQBPAK1kOWWLLFk5dy S1vzjX+2051EKKL0aVBiIxpMsSFj99WKOY/46o9/ogBfQFO3oH1klVyVvmBlC51EcB QkiQPcO9vLvViO59E+6nOyW66VyJyFFCNjKMzZrlVHxO8ZfnKHRaUgzLOyPq2vmpvy +rhW2g3FSS0g1LvP5oBEUjqGUCoGKuzxV0F625X9rewuwG2fnx8FzAsrRboiwCSB9Z mHwIDLugJWFh1lSbR0xP4u2z4cRujR/KEDfTBIej9/GSliYt3D0uLkUbvJsBtU4LZV mr4SX8HsumXJQ== Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3776.700.51.11.2\)) Subject: Re: to_date()/to_timestamp() silently accept month=0 and day=0 From: Daniel Gustafsson In-Reply-To: Date: Thu, 23 Apr 2026 10:11:47 +0200 Cc: Ayush Tiwari , pgsql-bugs@lists.postgresql.org Content-Transfer-Encoding: quoted-printable Message-Id: References: To: Michael Paquier X-Mailer: Apple Mail (2.3776.700.51.11.2) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On 23 Apr 2026, at 09:57, Michael Paquier wrote: > Perhaps we could consider strengthening such inputs on HEAD once v20 > opens for business? It would be really a scary thing to backpatch, > still a major release is a different thing. This could definitely not be backpatched IMO, a quick check in v14 shows = the same behaviour. The gregorian calendar goes from BC1 to AD1 and does = not define a year 0, to_date('0000','YYYY') correctly returns year 0001, = handling months/days in the same way at least makes it consistent (though I = didn't scour the archives to see if it was intentionally done like that). -- Daniel Gustafsson