Re: to_date()/to_timestamp() silently accept month=0 and day=0
| От | Daniel Gustafsson |
|---|---|
| Тема | Re: to_date()/to_timestamp() silently accept month=0 and day=0 |
| Дата | |
| Msg-id | FE1D12FF-7E5D-4ED0-A59F-BEA6DEF7EE2C@yesql.se обсуждение |
| Ответ на | Re: to_date()/to_timestamp() silently accept month=0 and day=0 (Michael Paquier <michael@paquier.xyz>) |
| Ответы |
Re: to_date()/to_timestamp() silently accept month=0 and day=0
Re: to_date()/to_timestamp() silently accept month=0 and day=0 |
| Список | pgsql-bugs |
> On 23 Apr 2026, at 09:57, Michael Paquier <michael@paquier.xyz> wrote:
> Perhaps we could consider strengthening such inputs on HEAD once v20
> opens for business? It would be really a scary thing to backpatch,
> still a major release is a different thing.
This could definitely not be backpatched IMO, a quick check in v14 shows the
same behaviour. The gregorian calendar goes from BC1 to AD1 and does not
define a year 0, to_date('0000','YYYY') correctly returns year 0001, handling
months/days in the same way at least makes it consistent (though I didn't scour
the archives to see if it was intentionally done like that).
--
Daniel Gustafsson
В списке pgsql-bugs по дате отправления: