"Kevin Grittner" <kevin.gritt...@wicourts.gov> writes:
> Andrew Gierth <and...@tao11.riddles.org.uk> wrote:
>> Given that the spec requires that 2009-01-31 + interval 1 month =
>> 2009-02-31 (yes, really! see general rule 4 in subsection 6.30), I
>> think we can safely ignore virtually everything it says about
>> date/time handling.
 
> Codd went on at some length about why this is the right thing to do.
> He was highly critical of systems where adding a month to a date and
> then subtracting month from the result could result in a date which
> was off from the original date by as much as three days.  As a
> mathematician he felt strongly that "(x + y) - y" should equal x --
> even when x is a date and y is an interval.

[ shrug... ]  We *have* that property, for sane cases such as adding and
subtracting a fixed number of days.  For less sane cases, I would point
out to Codd that the current calendar system was not designed by
mathematicians, and trying to superimpose strict mathematical rules on
it just leads to nonsense (like the spec's requirements).

                        regards, tom lane

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to