Date calc bug - Mailing list pgsql-bugs

From Olivier PRENANT
Subject Date calc bug
Date
Msg-id Pine.UW2.4.21.0001021513050.11391-100000@server.pyrenet.fr
Whole thread Raw
List pgsql-bugs
Happy new year to you all!!

I've run into this problem 3 days ago:

Script started on Sun Jan  2 14:59:03 2000
~ 14:59:04: psql
Welcome to the POSTGRESQL interactive sql monitor:
  Please read the file COPYRIGHT for copyright terms of POSTGRESQL
[PostgreSQL 6.5.3 on i586-pc-unixware7.0.1, compiled by cc ]

   type \? for help on slash commands
   type \q to quit
   type \g or terminate with semicolon to execute query
 You are currently connected to the database: ohp

ohp=> select '01-12-1999'::datetime + '@ 1 month - 1 sec' as bug;

bug
----------------------------
Thu 30 Dec 23:59:59 1999 MET
(1 row)
    ^^
Should be 31!!

ohp=> select '01-01-2000'::datetime + '@ 1 month - 1 sec' as good;

good
----------------------------
Mon 31 Jan 23:59:59 2000 MET
(1 row)
Seems OK after Jan 1rst!!

Any idea?

Regards
--
Olivier PRENANT             Tel:    +33-5-61-50-97-00 (Work)
Quartier d'Harraud Turrou           +33-5-61-50-97-01 (Fax)
31190 AUTERIVE                      +33-6-07-63-80-64 (GSM)
FRANCE                      Email: ohp@pyrenet.fr
------------------------------------------------------------------------------
Make your life a dream, make your dream a reality. (St Exupery)

pgsql-bugs by date:

Previous
From: greathunterbob@webtv.net (Robert Mcbride)
Date:
Subject: what can i do about the 554 hop count/
Next
From: wrobell
Date:
Subject: A bug