Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 739649FB2B2 for ; Fri, 6 Oct 2006 06:35:53 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 26469-03 for ; Fri, 6 Oct 2006 06:35:47 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from achille.dalibo.net (achille.dalibo.net [212.85.153.230]) by postgresql.org (Postfix) with ESMTP id AD7CC9FB2AF for ; Fri, 6 Oct 2006 06:35:47 -0300 (ADT) Received: from localhost (localhost.localdomain [127.0.0.1]) by achille.dalibo.net (Postfix) with ESMTP id 53E3715F5F; Fri, 6 Oct 2006 11:35:44 +0200 (CEST) Received: from achille.dalibo.net ([127.0.0.1]) by localhost (achille [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 13880-10; Fri, 6 Oct 2006 11:35:42 +0200 (CEST) Received: from [192.168.0.14] (laf31-2-82-224-249-154.fbx.proxad.net [82.224.249.154]) by achille.dalibo.net (Postfix) with ESMTP id E020515F5E; Fri, 6 Oct 2006 11:35:41 +0200 (CEST) Message-ID: <45262362.4030101@argudo.org> Date: Fri, 06 Oct 2006 11:35:30 +0200 From: Jean-Paul Argudo User-Agent: Thunderbird 1.5.0.7 (X11/20060927) MIME-Version: 1.0 To: pgsql-sql@postgresql.org Cc: Tom Lane , Martin Marques Subject: Re: age() vs. timestamp substraction References: <29752.1160073444@sss.pgh.pa.us> In-Reply-To: <29752.1160073444@sss.pgh.pa.us> X-Enigmail-Version: 0.94.0.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at dalibo.com X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200610/77 X-Sequence-Number: 26466 Hi all, > Where did you get that idea? age's reference point is current_date (ie, > midnight) not now(). There are also some differences in the calculation > compared to a plain timestamp subtraction. I'm jumping on this thread to point out a little strange thing to me. CURRENT_DATE, converted (stupidly) as a string *with* hour is "current date at mid-day": test=# select to_char(current_date,'YYYY-MM-DD HH:MI:SS'); to_char --------------------- 2006-10-06 12:00:00 (1 ligne) It was a day when I had to debug a strange behaviour in a customer's (bad) code :-) Cheers, -- Jean-Paul Argudo www.PostgreSQLFr.org www.dalibo.com