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 09:13:14
Message-ID: CAJTYsWVEk5vdy8of2DCWzDNJgHUNL0p0Dt6b1zkgmvmNo3ht6w@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi,

On Fri, 24 Apr 2026 at 13:46, Ayush Tiwari <ayushtiwari(dot)slg01(at)gmail(dot)com>
wrote:

> Hi,
>
> On Fri, 24 Apr 2026 at 13:42, Daniel Gustafsson <daniel(at)yesql(dot)se> wrote:
>
>> > On 24 Apr 2026, at 00:14, Michael Paquier <michael(at)paquier(dot)xyz> wrote:
>> >
>> > On Thu, Apr 23, 2026 at 10:06:41PM +0530, Ayush Tiwari wrote:
>> >> If we are not going to change the behaviour, imo, we should
>> >> atleast add a test case to depict this scenario and comment
>> >> that says this is expected behaviour according to the community.
>> >
>> > Yes, we could close the gap with some tests, at least.
>>
>> +1. Do you want to work on this Ayush?
>>
>
> Yes, I'll send a patch with test case today.
>
>
Attached patch, please review.

Regards,
Ayush

Attachment Content-Type Size
0001-Add-regression-tests-for-to_date-to_timestamp-zero-m.patch application/octet-stream 3.5 KB

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message PG Bug reporting form 2026-04-24 11:56:38 BUG #19465: Inconsistency in EXP(LN(x)) equivalence leading to different COUNT result in PostgreSQL
Previous Message Oleg Gurev 2026-04-24 08:38:14 [BUG] Windows Server 2019 build fail