Re: [BUGS] date function 'age' problem

2002-04-03 Thread Thomas Lockhart

> osk=> select age('2001-03-29','2001-03-01');
> ---
>  27 days 23:00
> osk=> select age('2002-03-29','2002-03-01');
> ---
>  1 mon
> osk=> select version();
>  PostgreSQL 7.1.3 on i686-pc-linux-gnu, compiled by GCC 2.95.4
...
> look at the difference betwen results of execution function 'age' for the
> same time interval in year 2001 and 2002. why there is '1 mon' when it
> should be '27 days'.

You may be calculating an interval across daylight savings time
boundaries, which may have been done without accounting for time zones
in the version you are running. I'm not able to reproduce the problem on
my 7.2 installation:

thomas=# set time zone 'pst8pdt';
SET VARIABLE
thomas=# select age('2001-03-29','2001-03-01');
-
 28 days
thomas=# select age('2002-03-29','2002-03-01');
-
 28 days
thomas=# select version();
---
 PostgreSQL 7.2 on i686-pc-linux-gnu, compiled by GCC 2.96


May be time to upgrade...

   - Thomas

---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])



[BUGS] date function 'age' problem

2002-04-02 Thread Konrad Gdowski

hello

i've got the following error:

here is the output:

###
osk=> select age('2001-03-29','2001-03-01');
  age
---
 27 days 23:00
(1 row)

osk=> select age('2002-03-29','2002-03-01');
  age
---
 1 mon
(1 row)

osk=> select version();
version
---
 PostgreSQL 7.1.3 on i686-pc-linux-gnu, compiled by GCC 2.95.4
(1 row)

osk=>

#

look at the difference betwen results of execution function 'age' for the
same time interval in year 2001 and 2002. why there is '1 mon' when it
should be '27 days'.
thanks for any solutions to this problem.

best regards
konrad gdowski


---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html