Re: to_date()/to_timestamp() silently accept month=0 and day=0

From: Ayush Tiwari <ayushtiwari(dot)slg01(at)gmail(dot)com>
To: Daniel Gustafsson <daniel(at)yesql(dot)se>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: to_date()/to_timestamp() silently accept month=0 and day=0
Date: 2026-04-24 12:50:45
Message-ID: CAJTYsWXor+vwxEH4oxxjZcQi9bcxz=9OAFt7wQWRxpaA_HyGiQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Fri, 24 Apr 2026 at 18:14, Daniel Gustafsson <daniel(at)yesql(dot)se> wrote:

> > On 24 Apr 2026, at 11:13, Ayush Tiwari <ayushtiwari(dot)slg01(at)gmail(dot)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.
>

Looks good to me. Thank you!

Regards,
Ayush

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message David Rowley 2026-04-24 13:11:57 Re: BUG #19465: Inconsistency in EXP(LN(x)) equivalence leading to different COUNT result in PostgreSQL
Previous Message Daniel Gustafsson 2026-04-24 12:44:04 Re: to_date()/to_timestamp() silently accept month=0 and day=0