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

Started by 张鹏超about 2 hours ago1 messageshackers
Jump to latest
#1张鹏超
zhangpengchao@highgo.com

On 2026-04-22, Ayush Tiwari wrote:

Inputs with month = 00 or day = 00 are accepted silently and normalized
to January / day 1, instead of being rejected as out of range.

I tested the v2 patch[1]/messages/by-id/attachment/195491/v2-0001-Add-regression-tests-for-zero-month-day-handling-.patchRegards,zpc on current master (CentOS Stream 9, x86_64):

- make check: All 245 tests passed, no regressions.
- Manually verified the zero month/day behavior matches expected
output in the patch. Out-of-range values still error correctly.

The new regression tests document this long-standing behavior cleanly.
No issues found.

As a new reviewer, I'd appreciate any feedback on my review approach.

[1]: /messages/by-id/attachment/195491/v2-0001-Add-regression-tests-for-zero-month-day-handling-.patchRegards,zpc