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 77C8ED7B56 for ; Wed, 7 Sep 2005 04:22:21 -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 39391-01 for ; Wed, 7 Sep 2005 07:22:15 +0000 (GMT) Received: from web33408.mail.mud.yahoo.com (web33408.mail.mud.yahoo.com [68.142.206.140]) by svr1.postgresql.org (Postfix) with SMTP id DFF02D6D85 for ; Wed, 7 Sep 2005 04:22:15 -0300 (ADT) Received: (qmail 74178 invoked by uid 60001); 7 Sep 2005 07:22:16 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=yXDrscK1cgbxXjrFewsUXDtLVglpfjEkMSpmvrKX5pCyTKWvftalSxqecFsDnCDEd9nmz5jYaUj6Zc1CBE4TXEA+IV1qzk/eoQvl31P8Yb6vhVRWKX4MLhvX+5Ge+odW/cjP+PhQ8jBuljJwu74KtVJJ2OMAGT9ue5vzw2BbNYg= ; Message-ID: <20050907072216.74176.qmail@web33408.mail.mud.yahoo.com> Received: from [222.124.236.171] by web33408.mail.mud.yahoo.com via HTTP; Wed, 07 Sep 2005 00:22:16 PDT Date: Wed, 7 Sep 2005 00:22:16 -0700 (PDT) From: Louise Catherine Subject: Re: AGE function To: pgsql-sql@postgresql.org Cc: Michael Fuhr In-Reply-To: <20050907062634.GA14474@winnie.fuhr.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=2.286 required=5 tests=[AWL=0.501, DNS_FROM_RFC_ABUSE=0.374, FROM_HAS_MIXED_NUMS=0.298, FROM_HAS_MIXED_NUMS3=1.113] X-Spam-Level: ** X-Archive-Number: 200509/69 X-Sequence-Number: 22616 --- Michael Fuhr wrote: > On Tue, Sep 06, 2005 at 10:05:06PM -0700, Louise > Catherine wrote: > > 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 > > > > at postgre 8.0.3, the result : > > age > > --------------- > > 4 years 11 mons > > > > My question : > > 1. How does postgre 7.3.3 calculate AGE function? > > 2. Why the result produced by postgre 7.3.3 > > is different from postgre 8.0.3 ? > > I get the same answer ("4 years 11 mons") in 7.2.8, > 7.3.10, 7.4.8, > 8.0.3, and 8.1beta1. Have you verified that > to_date() is returning > the correct dates? What are the results of the > following queries > on each of your systems? > > SELECT TO_DATE('19991201','yyyymmdd'), > TO_TIMESTAMP('19991201','yyyymmdd'); > SELECT TO_DATE('20041101','yyyymmdd'), > TO_TIMESTAMP('20041101','yyyymmdd'); > SHOW TimeZone; at PostgreSQL 7.3.3 : to_date to_timestamp ---------- --------------------- 1999-12-01 1999-12-01 00:00:00+07 to_date to_timestamp ---------- --------------------- 2004-11-01 2004-11-01 00:00:00+07 TimeZone ----------- unknown at PostgreSQL 8.0.3 : to_date to_timestamp ---------- --------------------- 1999-12-01 1999-12-01 00:00:00+07 to_date to_timestamp ---------- --------------------- 2004-11-01 2004-11-01 00:00:00+07 TimeZone ------------ Asia/Jakarta > What operating system are you using? I'm using SuSE Linux 9.0 for the operating system The result from your queries are similar, so what's wrong in my queries? What should I do? Cause I must migrate database from PostgreSQL 7.3.3 to PostgreSQl 8.0.3. > BTW, it's "PostgreSQL" or "Postgres," not "postgre." Sorry about the name :) Thanks, Louise __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com