pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Louise Catherine <r1c4n@yahoo.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: AGE function
Date: Wed, 07 Sep 2005 11:13:01 -0400
Message-ID: <27428.1126105981@sss.pgh.pa.us> (raw)
In-Reply-To: <20050907050506.55141.qmail@web33402.mail.mud.yahoo.com>
References: <20050907050506.55141.qmail@web33402.mail.mud.yahoo.com>

Louise Catherine <r1c4n@yahoo.com> writes:
> When I execute this statement : 
> select AGE(TO_DATE('20041101','yyyymmdd'),
> TO_DATE('19991201','yyyymmdd'))

> at postgre 7.3.3, the result :
>  age                   
>  --------------------- 
>  4 years 11 mons 1 day 

With TimeZone set to 'Asia/Jakarta' on a Linux machine, I can reproduce
that behavior in 7.3.* but not 7.4 and later.  I believe this is the
relevant change:

2004-12-01 14:57  tgl

	* src/backend/utils/adt/timestamp.c (REL7_4_STABLE): Fix
	timestamptz_age() to do calculation in local timezone not GMT, per
	bug 1332.

and here is a link to the discussion that prompted the change:
http://archives.postgresql.org/pgsql-bugs/2004-12/msg00013.php

			regards, tom lane



view thread (7+ messages)

Message-ID: <27428.1126105981@sss.pgh.pa.us>
Permalink:  ../27428.1126105981@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/27428.1126105981@sss.pgh.pa.us

 · 

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: tgl@sss.pgh.pa.us, r1c4n@yahoo.com
  Subject: Re: AGE function
  In-Reply-To: <27428.1126105981@sss.pgh.pa.us>

* 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