Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id D6BDD9FB319 for ; Thu, 5 Oct 2006 15:27:58 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 45552-07 for ; Thu, 5 Oct 2006 18:27:52 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey- Received: from bugs.unl.edu.ar (bugs.unl.edu.ar [168.96.132.208]) by postgresql.org (Postfix) with ESMTP id 80D6A9FB308 for ; Thu, 5 Oct 2006 15:27:50 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by bugs.unl.edu.ar (Postfix) with ESMTP id 08BC76F910 for ; Thu, 5 Oct 2006 15:27:47 -0300 (ART) Received: from bugs.unl.edu.ar ([127.0.0.1]) by localhost (bugs.unl.edu.ar [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id GS7yEApPUp6F for ; Thu, 5 Oct 2006 15:27:46 -0300 (ART) Received: by bugs.unl.edu.ar (Postfix, from userid 33) id 418ED6F90A; Thu, 5 Oct 2006 15:27:46 -0300 (ART) To: pgsql-sql@postgresql.org Subject: age() vs. timestamp substraction MIME-Version: 1.0 Date: Thu, 5 Oct 2006 15:27:46 -0300 From: Martin Marques Organization: Cetul - UNL Message-ID: X-Sender: martin@bugs.unl.edu.ar User-Agent: RoundCube Webmail/0.1b Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit 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/61 X-Sequence-Number: 26450 I just found this problem with the age() function, which AFAIK should give the same resulte as a subtraction of the argument from now(), but it doesn't. prueba=> SELECT (now() - tc.last_cron),age(tc.last_cron),tc.intervalo FROM tareas_cron tc ; ?column? | age | intervalo -------------------------------------+-------------------------------+----------- @ 1 day 15 hours 13 mins 12.06 secs | @ 23 hours 59 mins 58.47 secs | @ 1 day @ 15 hours 13 mins 12.06 secs | @ 1.52 secs ago | @ 30 mins @ 15 hours 13 mins 12.08 secs | @ 1.50 secs ago | @ 10 mins prueba=> SELECT version(); version ---------------------------------------------------------------------------------------- PostgreSQL 8.1.3 on i486-pc-linux-gnu, compiled by GCC cc (GCC) 4.0.3 (Debian 4.0.3-1) Any ideas on why? I starting to change my queries so they don't have the age() function anymore. -- --------------------------------------------------------- Lic. Martín Marqués | SELECT 'mmarques' || Centro de Telemática | '@' || 'unl.edu.ar'; Universidad Nacional | DBA, Programador, del Litoral | Administrador ---------------------------------------------------------