Tom Lane wrote:

"Andrew Dunstan" <[EMAIL PROTECTED]> writes:


Looks like it is caused by the switch to the Gregorian calendar in 1752,
when 11 days were chopped out of September ( in England and America -
elsewhere anywhere between Oct 1582 and early 20th century).



There was some discussion awhile back about extending PG's date code to know about the Julian calendar, but the idea pretty much died when it was pointed out that you'd need locale-specific information about exactly when the switchover occurred.

SQL99 makes it perfectly clear that all datetime values are Gregorian,
for example we find wording like this in the <literal> section:

        9) If <date value> is specified, then it is interpreted as a date
           in the Gregorian calendar.

So one could argue that the existing PG behavior is SQL-compliant.
I tend to regard this as an easy out, but nonetheless it's an available
defense if someone tries to beat you up about PG's "wrong answers".


Perhaps we need a function or two to convert pre-gregorian dates to gregorian dates and vice versa, with the cutover date either a configuration variable (default the 1752 date) or a parameter of the function.

e.g. j_to_g('1700-01-01'::date) => '1700-01-13'
      j_to_g('1800-01-01'::date) => '1800-01-01'

just a thought

andrew


---------------------------(end of broadcast)--------------------------- TIP 7: don't forget to increase your free space map settings

Reply via email to