Date calc bug

From: Olivier PRENANT <ohp(at)pyrenet(dot)fr>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Date calc bug
Date: 2000-01-02 14:15:47
Message-ID: Pine.UW2.4.21.0001021513050.11391-100000@server.pyrenet.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

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(at)pyrenet(dot)fr
------------------------------------------------------------------------------
Make your life a dream, make your dream a reality. (St Exupery)

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2000-01-02 18:02:00 Re: [BUGS] Date calc bug
Previous Message Robert Mcbride 2000-01-01 23:39:28 what can i do about the 554 hop count/

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2000-01-02 18:02:00 Re: [BUGS] Date calc bug
Previous Message Don Baccus 2000-01-02 03:09:38 Re: [HACKERS] dubious improvement in new psql