Re: AGE function

From: "A(dot) Kretschmer" <akretschmer(at)despammed(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: AGE function
Date: 2005-09-07 07:46:35
Message-ID: 20050907074635.GC18174@webserv.wug-glas.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

am 06.09.2005, um 22:05:06 -0700 mailte Louise Catherine folgendes:
> When I execute this statement :
> select AGE(TO_DATE('20041101','yyyymmdd'),
> TO_DATE('19991201','yyyymmdd'))
> ...
> 4 years 11 mons 1 day
> 4 years 11 mons
>
> My question :
> 1. How does postgre 7.3.3 calculate AGE function?
> 2. Why the result produced by postgre 7.3.3
> is different from postgre 8.0.3 ?

How long is a month? 28 days, 29 days, 30 days, 31 days?

select TO_DATE('20041101','yyyymmdd') - TO_DATE('19991201','yyyymmdd');

This is under 7.2.1 and 8.0.3 tha same: 1797. I guess, this is a
rounding problem.

Regards, Andreas
--
Andreas Kretschmer (Kontakt: siehe Header)
Heynitz: 035242/47212, D1: 0160/7141639
GnuPG-ID 0x3FFF606C http://wwwkeys.de.pgp.net
=== Schollglas Unternehmensgruppe ===

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Michael Fuhr 2005-09-07 14:24:54 Re: AGE function
Previous Message Louise Catherine 2005-09-07 07:22:16 Re: AGE function