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 1wFpO6-005b6l-2r for pgsql-bugs@arkaria.postgresql.org; Thu, 23 Apr 2026 08:26:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wFpO4-000lhD-33 for pgsql-bugs@arkaria.postgresql.org; Thu, 23 Apr 2026 08:26:16 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wFpO4-000lh5-25 for pgsql-bugs@lists.postgresql.org; Thu, 23 Apr 2026 08:26:16 +0000 Received: from mail-yw1-x1131.google.com ([2607:f8b0:4864:20::1131]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wFpO2-00000002cLx-2B6x for pgsql-bugs@lists.postgresql.org; Thu, 23 Apr 2026 08:26:16 +0000 Received: by mail-yw1-x1131.google.com with SMTP id 00721157ae682-79885f4a8ffso68025817b3.3 for ; Thu, 23 Apr 2026 01:26:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1776932773; cv=none; d=google.com; s=arc-20240605; b=KxIZS7AWnESDhO3aBOTwS9flzskus64/9kR4fOQQ0yYciF8tq1lPmqwD3o2Tp94vHQ hmV3PM3VBmELcgnNTuLTH0s+I5DtIK0YyppndWvN8tQoltBU73t8ctBTXxPj0LcVnU5d Qq+wx7zC0O2J9KTpgN5Dl1liFV8H0bwOXZrliqKlw23yLIXIvu5TvSyqs722RQ/tBHNQ yu5S4/4UVdaLlCjnCUwTyNraGgZZHNcXys05vgNJlFS3SWfFTkKKZ1vWQlIBPqPSw/nl XsAU01dkMwbsY0LlrYWOtspjfiJnkGnBS+NE70sbOvGiSuonTPwHiXdDH0BrvxbRvW62 OOsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=ShNO+wuMXJVBPUJ5Tzg/AYsYYDn1HlrvIY2J9Oezqfs=; fh=WOmIz1uRiXhLesS7dXT1jvp19nNcWMB3YNPzmQ1bv2U=; b=LVJ09Fv+4h2+VLMW63ZlSDfwvVnNKCjbFNEgSuX+q4DmGVr7psI4TcdKe1VNZ79Zn7 RZaO/7VFq3BIMGI+JfO30b9ILa0J8h4OxdRUhKcjrpKCUEiJmqH1/SDWVO5K/gYeDQt9 +sfh2oZT7gH7q2qT7b6qtWj3gKZRbfuV6V1ITWlO2NYKqjfTK/wwHVUBG8uPb7vQzHfY Eb7/n06538ZoWPRvT288PeBGJ4cZvRdH7ok2RDFCyi3/pxpeVeJIazI/iaSbiRKjKNNL vG6v2jRxSQn3bRBcCSGmztJZ939XY0oSLkgsqA65KU/EWsRDdZoEbHYbh/3BzKAKuLRY PpBg==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1776932773; x=1777537573; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=ShNO+wuMXJVBPUJ5Tzg/AYsYYDn1HlrvIY2J9Oezqfs=; b=KCiQ2baOJBhD4tUR8WS13GRYWlrM5YeKv/alQThLNVglz6clkX7D14QvTrnPyPWbg+ S9eILvGu1+jnUSjhsCy95dRPLfFgFvAgwKsWlwYeMfDNt4t166sGu4zpjvlANcYzrB+T awfQBUZZx9iNvbVTnl/tkM17lc8Evp0hTJ1fnqr5bJt/pW+KlQEJwKJNssQgYJSChOaa bmpbZQzmJ0HzVADFl+HRfalgA4SFQOWhhmq2S3zFri9WNvxo15TolWPBJHZxCeDe4y2R +6USl8A3MVQa/8OH8DXAZdGhanPlB0EU4ZZj8+09/j7f6gfjyKfSZdh5Q4Yy5rRhzCE5 iyBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776932773; x=1777537573; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=ShNO+wuMXJVBPUJ5Tzg/AYsYYDn1HlrvIY2J9Oezqfs=; b=YFlBkSnE1G2KrF1SalrwWrAzIaFXBIuD8BcHEqtKYjPngKozg9GE208XxyiVYGTtpe 3StqTm5KZIMGmvstiANgrPp9sUuiszBqr4hgQdGfHO+Oyr+OTDbqdrTvNFfxvPtYrJpb YxYEIBK45VYXJHbVSjIYv5E6ORqXTowuCfVEgdDkVABExHv19uWbuG8SHn4VgQwRoIWp wjcrEvIeXnjdApLXO78YSC5Z8QDin+Thd5UxaipmTzQpV8vaiSt9jBzyOTryTvtBozcW HfMtXyahiex3oTraDOYTTm/hVhYkbUFeqrU/TnWu5ZIywHYZRP6Y/ZYpoBXUZV37Z+Dm Tn3Q== X-Forwarded-Encrypted: i=1; AFNElJ83wFi+AfTO8hB5AG1ZerM6xtE+DfVl6c7nIYXBDjbHASEa/Ib/qnd1z25RIqkCOjVmVS9+5hm4V9q3@lists.postgresql.org X-Gm-Message-State: AOJu0YxVvDOtOLtXWQASnNrd9qmQ2q3q839CoIlp+d7xPiHtRKlmmFYH zdHUotWMCLXdaj+YClQToFu7FsbBqHmvp4mbRiJhOIZNV7dijGBSihEyKWjJdDiw8441e1ufwAr vcSvVDdel8BTUI5Nesn+OLHrncFoRhg4= X-Gm-Gg: AeBDiets+mWwJIQAhTSgtA7YkxjhrIvw8CawFwkMVb0fTvFTyN4P9/65Q5s6yuvsKY9 iyjjvWjBqQ/TqRlEv8lEZ2ZqBoKNLf7RewZ/FlBsolE1k5AsCl6IwMv0RNv1l3b6lOHEK5V6f1e 03X+eyYW+YAtOf4p5b7pnkL3WBlzRxy1X1pRbic1uICCCC5gFtNDZh4gUv6KTWIZtywKgi5NvlL saYYBPr0Rhh4zZ03sPQNDO2v8t+amSblK6pYFoax1g8B9YcS7shYB46P86vfWbidw1cyJBRWXxS FuvR2W152/SXHOV2jg== X-Received: by 2002:a05:690c:9211:b0:7b4:31cc:376d with SMTP id 00721157ae682-7b9ecfcec81mr232301437b3.39.1776932772742; Thu, 23 Apr 2026 01:26:12 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Ayush Tiwari Date: Thu, 23 Apr 2026 13:56:01 +0530 X-Gm-Features: AQROBzBO7vqKVrHxjbxNzE_0fwaABpaLh_MblbU0ZBUlSqwYpfoHsuM-fvsNXhc Message-ID: Subject: Re: to_date()/to_timestamp() silently accept month=0 and day=0 To: Daniel Gustafsson Cc: Michael Paquier , pgsql-bugs@lists.postgresql.org Content-Type: multipart/alternative; boundary="000000000000b5962206501c6602" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000b5962206501c6602 Content-Type: text/plain; charset="UTF-8" Hi, On Thu, 23 Apr 2026 at 13:41, Daniel Gustafsson wrote: > > 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). > > ++ on not backporting it since it may break existing applications. But we should consider strengthening such inputs for v20. Regards, Ayush --000000000000b5962206501c6602 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi,

On Thu, 23 Apr 2026 at 13:41= , Daniel Gustafsson <daniel@yesql.se<= /a>> wrote:
&= gt; On 23 Apr 2026, at 09:57, Michael Paquier <michael@paquier.xyz> wrote:

> Perhaps we could consider strengthening such inputs on HEAD once v20 > opens for business?=C2=A0 It would be really a scary thing to backpatc= h,
> still a major release is a different thing.

This could definitely not be backpatched IMO, a quick check in v14 shows th= e
same behaviour.=C2=A0 The gregorian calendar goes from BC1 to AD1 and does = not
define a year 0, to_date('0000','YYYY') correctly returns y= ear 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).


++ on not backporting it since it may break existing applica= tions.

=C2=A0But we should consider strengthening such inputs for v2= 0.

Regards,
Ayush
--000000000000b5962206501c6602--