> > > prova=> select date '1901-02-29';
> > > ERROR: date_in: day must be limited to values 1 through 28
> > > prova=> select date '1902-02-29';
> > > ----------
> > > 1902-03-01
> > Any body knows why PostgreSQL checks for date validity only
> > for dates less than 1902 and greater than 2037 ?
postgres=> select date '1902-02-29 UTC';
ERROR: date_in: day must be limited to values 1 through 28
For dates somewhere close the the Unix system time range, I use system
routines to determine the local time zone if it was not specified in
the input. That call also shifts/resolves the input time fields to be
consistant. Afterwards, I check for a valid day, but the shift has
already hidden the problem.
I'll look at moving the checks to within the parsing code, to just
before the time zone is resolved.
This will also affect the behavior of datetime and abstime.
- Tom
--
Thomas Lockhart lockhart@alumni.caltech.edu
South Pasadena, California