bizarre AGE behaviour

From: DHS Webmaster <webmaster(at)dhs-club(dot)com>
To: pgsql-admin <pgsql-admin(at)postgresql(dot)org>
Subject: bizarre AGE behaviour
Date: 2004-03-03 17:19:17
Message-ID: 40461395.5324CFEE@dhs-club.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hello all,
Many thanks for this fine product.
We began encountering some unexpected date related errors this week and
after further investigation found the following. We use the postgres AGE
function in a custom function. The AGE function has begun to throw some
unanticipated results back. This has not happened before and my first
guess is that it may be leap year related. Here are some examples.

This is good...
network=# select age('04-01-04','03-01-04');
age
-------
1 mon
(1 row)

This isn't...
network=# select age('05-01-04','03-01-04');
age
---------------------
1 mon 30 days 23:00
(1 row)

Now it gets really strange......
network=# select age('06-01-04','04-01-04');
age
---------------------
1 mon 29 days 23:00
(1 row)

This may have been addressed in the past (I subscribe to this list) and
I just missed it, but is there a simple fix for this problem?
Thanks.
--
Bill MacArthur
Webmaster
The DHS Club, Inc.
The Best Is Yet To Come!

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Steve Crawford 2004-03-03 18:00:05 Re: bizarre AGE behaviour
Previous Message Richard Huxton 2004-03-03 08:14:31 Re: [ADMIN] Schema comparisons