pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Louise Catherine <r1c4n@yahoo.com>
To: pgsql-sql@postgresql.org
Cc: Michael Fuhr <mike@fuhr.org>
Subject: Re: AGE function
Date: Wed, 7 Sep 2005 00:22:16 -0700 (PDT)
Message-ID: <20050907072216.74176.qmail@web33408.mail.mud.yahoo.com> (raw)
In-Reply-To: <20050907062634.GA14474@winnie.fuhr.org>

--- Michael Fuhr <mike@fuhr.org> 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 



view thread (7+ messages)  latest in thread

Message-ID: <20050907072216.74176.qmail@web33408.mail.mud.yahoo.com>
Permalink:  ../20050907072216.74176.qmail@web33408.mail.mud.yahoo.com/
Also on:    postgresql.org/message-id/20050907072216.74176.qmail@web33408.mail.mud.yahoo.com

 · 

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: r1c4n@yahoo.com, mike@fuhr.org
  Subject: Re: AGE function
  In-Reply-To: <20050907072216.74176.qmail@web33408.mail.mud.yahoo.com>

* 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