Re: to_date()/to_timestamp() silently accept month=0 and day=0 - Mailing list pgsql-bugs

From Daniel Gustafsson
Subject Re: to_date()/to_timestamp() silently accept month=0 and day=0
Date
Msg-id 1B595919-2596-4CB3-BC39-DDCCB9876E56@yesql.se
Whole thread
In response to Re: to_date()/to_timestamp() silently accept month=0 and day=0  (Ayush Tiwari <ayushtiwari.slg01@gmail.com>)
Responses Re: to_date()/to_timestamp() silently accept month=0 and day=0
List pgsql-bugs
> On 24 Apr 2026, at 11:13, Ayush Tiwari <ayushtiwari.slg01@gmail.com> wrote:

> Attached patch, please review.

LGTM for the most part, I don't really think we need to use both to_date and
to_timestamp though, we can save a few cycles there.  I rewrote the comments to
match the rest of the file, and moved to where to where we test for year 0000
since it seems like a better place.  Also took the liberty to use year 100 in
one of the testcase, while the year is superfluous for the test in question,
year 100 was previously untested so this will increase test coverage for free.

--
Daniel Gustafsson


Attachment

pgsql-bugs by date:

Previous
From: Richard Guo
Date:
Subject: Re: BUG #19418: SQL/JSON JSON_VALUE() does not conform to ISO/IEC 9075-2:2023(E) 6.34
Next
From: Ayush Tiwari
Date:
Subject: Re: to_date()/to_timestamp() silently accept month=0 and day=0