Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-bugs by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group