X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id F3D1CD7032 for ; Wed, 7 Sep 2005 12:13:07 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 54976-01 for ; Wed, 7 Sep 2005 15:13:05 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id 2F03DD6F44 for ; Wed, 7 Sep 2005 12:13:02 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id j87FD1qc027429; Wed, 7 Sep 2005 11:13:01 -0400 (EDT) To: Louise Catherine Cc: pgsql-sql@postgresql.org Subject: Re: AGE function In-reply-to: <20050907050506.55141.qmail@web33402.mail.mud.yahoo.com> References: <20050907050506.55141.qmail@web33402.mail.mud.yahoo.com> Comments: In-reply-to Louise Catherine message dated "Tue, 06 Sep 2005 22:05:06 -0700" Date: Wed, 07 Sep 2005 11:13:01 -0400 Message-ID: <27428.1126105981@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.006 required=5 tests=[AWL=0.006] X-Spam-Level: X-Archive-Number: 200509/72 X-Sequence-Number: 22619 Louise Catherine 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