Re: Day of week question - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: Day of week question
Date
Msg-id Pine.LNX.4.44.0310051357110.2745-100000@peter.localdomain
Whole thread Raw
In response to Day of week question  (Michael Meskes <meskes@postgresql.org>)
List pgsql-hackers
Michael Meskes writes:

> mm=# select to_char('1000/01/01'::date,'D');
>  to_char
>  ---------
>  4
> (1 row)
>
> Thus we believe 1000/1/1 is a Wednesday. cal says:

> Thus 1000/1/1 is a Monday. Is this a bug in cal? Or do we produce the
> wrong output? Or do I simply misread the output?

cal takes into account the change from the Julian to the Gregorian
calendar.  PostgreSQL assumes that the Gregorian calendar is valid for all
times in the past.  So both answers are correct given those assumptions.

-- 
Peter Eisentraut   peter_e@gmx.net



pgsql-hackers by date:

Previous
From: Mike Mascari
Date:
Subject: Re: Index/Function organized table layout
Next
From: "Andrew Dunstan"
Date:
Subject: Re: Day of week question