Re: BUG #4878: function age() give a wrong interval - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #4878: function age() give a wrong interval
Date
Msg-id 20021.1245938608@sss.pgh.pa.us
Whole thread Raw
In response to Re: BUG #4878: function age() give a wrong interval  ("Philippe Amelant" <pamelant@companeo.com>)
List pgsql-bugs
"Philippe Amelant" <pamelant@companeo.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

pgsql-bugs by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: BUG #4879: bgwriter fails to fsync the file in recovery mode
Next
From: "Andreas Wenk"
Date:
Subject: BUG #4881: KDE 4.2 not running any more when installing one click installer from Enterprise DB