Re: [HACKERS] Re: [GENERAL] leap day bug after 1901

From: Thomas Lockhart <lockhart(at)alumni(dot)caltech(dot)edu>
To: Josi Soares <jose(at)sferacarta(dot)com>, hackers <pgsql-hackers(at)postgreSQL(dot)org>, general <pgsql-general(at)postgreSQL(dot)org>
Subject: Re: [HACKERS] Re: [GENERAL] leap day bug after 1901
Date: 1999-04-13 16:19:11
Message-ID: 37136E7F.F2929BFC@alumni.caltech.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> > > 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(at)alumni(dot)caltech(dot)edu
South Pasadena, California

In response to

Browse pgsql-general by date

  From Date Subject
Next Message De Leersnijder Frederic 1999-04-13 16:21:38 Converting MS Access to postgres under linux.
Previous Message De Leersnijder Frederic 1999-04-13 16:16:57 Opening two databases at the same time?