pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jean-Paul Argudo <jean-paul@argudo.org>
To: pgsql-sql@postgresql.org
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Martin Marques <martin@bugs.unl.edu.ar>
Subject: Re: age() vs. timestamp substraction
Date: Fri, 06 Oct 2006 11:35:30 +0200
Message-ID: <45262362.4030101@argudo.org> (raw)
In-Reply-To: <29752.1160073444@sss.pgh.pa.us>
References: <cbcf271add3140fe7cff8d45f31af585@bugs.unl.edu.ar>
	<29752.1160073444@sss.pgh.pa.us>

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



view thread (5+ messages)  latest in thread

Message-ID: <45262362.4030101@argudo.org>
Permalink:  ../45262362.4030101@argudo.org/
Also on:    postgresql.org/message-id/45262362.4030101@argudo.org

 · 

reply

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: jean-paul@argudo.org, tgl@sss.pgh.pa.us, martin@bugs.unl.edu.ar
  Subject: Re: age() vs. timestamp substraction
  In-Reply-To: <45262362.4030101@argudo.org>

* 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