Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TgCqU-00069f-0Y for pgsql-bugs@arkaria.postgresql.org; Wed, 05 Dec 2012 11:08:54 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1TgCqT-0007cN-Fx for pgsql-bugs@arkaria.postgresql.org; Wed, 05 Dec 2012 11:08:53 +0000 Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Tfkpk-0000qw-Pd for pgsql-bugs@postgresql.org; Tue, 04 Dec 2012 05:14:17 +0000 Received: from smtp48.i.mail.ru ([94.100.177.108]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Tfkpi-0007Pr-3o for pgsql-bugs@postgresql.org; Tue, 04 Dec 2012 05:14:16 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=inbox.ru; s=mail; h=Content-Type:Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From; bh=GdmjMhxrKfLoR0kwaxdq3VTdmElxH7kVcjkI/QoNVBI=; b=kKtRTHpknhI/2fZY5t+sNVHcQQW7MdrdA4deC8cMR7eXQ629yGFQUMiG6En2KUHB5L7ctChmWLmd3rHEQ2lUYg/K2oKEalCoxmTFYEyCxYMYeUR0UvOMR7MH2AHnK96+zdjJasqNBTyXwzp9CcmHDbdJimDCG7R360lIXvyOqcg=; Received: from [87.228.61.221] (port=19660 helo=vault13.localnet) by smtp48.i.mail.ru with esmtpa (envelope-from ) id 1Tfkpf-0003ji-Lf; Tue, 04 Dec 2012 09:14:11 +0400 From: =?utf-8?B?0JDRgNGC0LXQvCDQkNC90LjRgdC40LzQvtCy?= To: Bruce Momjian , Alvaro Herrera Cc: pgsql-bugs@postgresql.org Subject: Re: BUG #7722: extract(epoch from age(...)) appears to be broken Date: Tue, 04 Dec 2012 09:16:14 +0400 Message-ID: <2042272.iJfXXT9BJj@vault13> User-Agent: KMail/4.8.4 (Linux/3.5.2; KDE/4.8.4; i686; ; ) In-Reply-To: <20121204021700.GC7675@momjian.us> References: <20121203060556.GA4601@alvh.no-ip.org> <20121204021700.GC7675@momjian.us> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Spam: Not detected X-Mras: Ok X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org Dear Mr. Herrera and Mr. Momjian, thank you for your feedback and for explaining that age() better not be used. On Monday 03 December 2012 03:05:57 Alvaro Herrera wrote: > The problem is that age() returns 30 days in one case, and "one month" in > the other; extract() then considers the month as equivalent to 30 days. > This is documented as such, see [1]. On Monday 03 December 2012 21:17:00 Bruce Momjian wrote: > Wow, that is a weird case. In the first test, we count the number of > days because it is less than a full month. In the second case, we call > it a full month, but then forget how long it is. Not sure how we could > improve this. Best regargs, Artem Anisimov. -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs