Bug reference: 17794 Logged by: Richard Neill Email address: postgresql@richardneill.org PostgreSQL version: 14.5 Operating system: Linux Description:
SELECT '0001-01-02' :: date => gives 0001-01-02 as expected
But, SELECT '0000-01-02' :: date => date/time field value out of range: "0000-01-02" I think it should be accepted as 2nd Jan, year 1 BC
and similarly, SELECT '-0001-01-02' :: date => invalid input syntax for type date: "-0001-01-02" I think this should be accepted, to mean 2nd Jan, year 2 BC.
We just stopped doing this "shift-by-one" in probably the one arguable case where doing so made sense.