Re: BUG #19650: to_date()/to_timestamp() silently truncate 4+-digit day-of-year input to the first three digits

From: Andrey Rachitskiy <pl0h0yp1(at)gmail(dot)com>
To: Kirill Reshke <reshkekirill(at)gmail(dot)com>
Cc: Clemenza Zhang <zxlmgsps2(at)gmail(dot)com>, 303677365(at)qq(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #19650: to_date()/to_timestamp() silently truncate 4+-digit day-of-year input to the first three digits
Date: 2026-11-20 10:43:41
Message-ID: CAB8bMivgta=DVf0QVit7f697om3Xe0gkxb+to5T52mTWWBUvmg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

пт, 20 нояб. 2026 г. в 14:36, Kirill Reshke <reshkekirill(at)gmail(dot)com>:

>
> I think v1 breaks
>
> SELECT to_date(
> to_char(DATE '2024-12-01', 'YYYY FMRM"X"'),
> 'YYYY FMRM"X"'
> );
>
> ?
>
> Hi Kirill,
You're right — I wasn't sure this needed fixing (I haven't seen cases like
this before), but I fixed it in v2 anyway.
Are there any other cases worth considering?

Attachment Content-Type Size
v2-0001-Reject-out-of-range-to_date-to_timestamp-template.patch text/x-patch 10.7 KB

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Gaurav Singh 2026-11-20 10:49:38 Re: postgres_fdw returns wrong rows for age(timestamptz, timestamptz) filters
Previous Message Kirill Reshke 2026-11-20 09:36:15 Re: BUG #19650: to_date()/to_timestamp() silently truncate 4+-digit day-of-year input to the first three digits