Re: age() vs. timestamp substraction - Mailing list pgsql-sql

From Tom Lane
Subject Re: age() vs. timestamp substraction
Date
Msg-id 29752.1160073444@sss.pgh.pa.us
Whole thread Raw
In response to age() vs. timestamp substraction  (Martin Marques <martin@bugs.unl.edu.ar>)
Responses Re: age() vs. timestamp substraction  (Martin Marques <martin@bugs.unl.edu.ar>)
Re: age() vs. timestamp substraction  (Jean-Paul Argudo <jean-paul@argudo.org>)
List pgsql-sql
Martin Marques <martin@bugs.unl.edu.ar> writes:
> I just found this problem with the age() function, which AFAIK should
> give the same resulte as a subtraction of the argument from now(),

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.
        regards, tom lane


pgsql-sql by date:

Previous
From: Andrew Sullivan
Date:
Subject: Re: Assigning a timestamp without timezone to a timestamp
Next
From: Martin Marques
Date:
Subject: Re: age() vs. timestamp substraction