From: Martin Marques <martin@bugs.unl.edu.ar>
To: pgsql-sql@postgresql.org
Subject: age() vs. timestamp substraction
Date: Thu, 5 Oct 2006 15:27:46 -0300
Message-ID: <cbcf271add3140fe7cff8d45f31af585@bugs.unl.edu.ar> (raw)
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
---------------------------------------------------------
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: martin@bugs.unl.edu.ar
Subject: Re: age() vs. timestamp substraction
In-Reply-To: <cbcf271add3140fe7cff8d45f31af585@bugs.unl.edu.ar>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox