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

From: Ayush Tiwari <ayushtiwari(dot)slg01(at)gmail(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Peter Eisentraut <peter(at)eisentraut(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Daniel Gustafsson <daniel(at)yesql(dot)se>, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: to_date()/to_timestamp() silently accept month=0 and day=0
Date: 2026-04-30 14:14:24
Message-ID: CAJTYsWU0_CxphN=dfY=DCMO=n2yg4h2wvt8W=wP30zAhxoiK6A@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi,

On Mon, 27 Apr 2026 at 04:13, Michael Paquier <michael(at)paquier(dot)xyz> wrote:

> On Fri, Apr 24, 2026 at 05:41:50PM +0200, Peter Eisentraut wrote:
> > Complaints from whom? Oracle rejects these, and PostgreSQL generally
> also
> > rejects these dates/times in other contexts. I think this should be
> > rejected.
>
> From folks who hypothetically rely on the existing zeroed inputs. :)
> Perhaps it's a far-fetched argument, and just to be clear I would not
> really object to a change of behavior on HEAD for v20, just to see
> where it goes in 2027.
>

I'll add this to the commitfest, so that we can circle back on this
once v20 development starts.

I think parallely we can commit Daniel's v2 patch, since
that correctly documents what Postgres has right now, and we'll
know what exactly to change if we decide to go the other way.

Regards,
Ayush

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Melanie Plageman 2026-04-30 22:04:54 Re: BUG #19418: SQL/JSON JSON_VALUE() does not conform to ISO/IEC 9075-2:2023(E) 6.34 <JSON value constructor>
Previous Message Tom Lane 2026-04-30 14:04:58 Re: Interval unit format bug