Re: BUG #4878: function age() give a wrong interval

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Philippe Amelant" <pamelant(at)companeo(dot)com>
Cc: "Frank Heikens" <frankheikens(at)mac(dot)com>, "pgsql-bugs(at)postgresql(dot)org" <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #4878: function age() give a wrong interval
Date: 2009-06-25 14:03:28
Message-ID: 20021.1245938608@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

"Philippe Amelant" <pamelant(at)companeo(dot)com> writes:
> In the first case you have a month with 31 days and in the second you
> have a month with 30 days

The interval comparisons have no way to know that, so they arbitrarily
assume that '1 month' is equivalent to '30 days'. This isn't going to
be changed. If you don't like it, don't use age(). A plain old
timestamp subtraction will probably provide behavior that's closer to
what you want.

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Andreas Wenk 2009-06-25 14:27:21 BUG #4881: KDE 4.2 not running any more when installing one click installer from Enterprise DB
Previous Message Heikki Linnakangas 2009-06-25 14:02:36 Re: BUG #4879: bgwriter fails to fsync the file in recovery mode