Bug #630: date/time storage problem: timestamp parsed incorrectly...

From: pgsql-bugs(at)postgresql(dot)org
To: pgsql-bugs(at)postgresql(dot)org
Subject: Bug #630: date/time storage problem: timestamp parsed incorrectly...
Date: 2002-04-09 01:35:16
Message-ID: 20020409013516.49FE447589D@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Sean Chittenden (sean(at)chittenden(dot)org) reports a bug with a severity of 2
The lower the number the more severe it is.

Short Description
date/time storage problem: timestamp parsed incorrectly...

Long Description
It looks like a bad parser or defaults for time values. The example code below explains the problem best. I'm not sure why, or where... but it took me about a day to track down (PostgreSQL is never wrong!). If I include a timezone, things seem to work. For some reason, only dates from yesterday and today break things... I think it's because -7 is the same as my timezone, PST (now -7).

Sample Code
CREATE TABLE timestamp_test (
utc_timestamp TIMESTAMP NOT NULL
);

INSERT INTO timestamp_tmp VALUES ('2002-4-7 2:0:0.0');
SELECT * from timestamp_tmp;
utc_date
------------------------
2036-06-02 22:55:24-07
(1 row)
INSERT INTO timestamp_tmp VALUES ('2002-4-7 -8 2:0:0.0');
SELECT * from timestamp_tmp;
utc_date
------------------------
2036-06-02 22:55:24-07
2002-04-07 03:00:00-07
(2 rows)

No file was uploaded with this report

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Thomas Lockhart 2002-04-09 02:08:21 Re: Bug #630: date/time storage problem: timestamp parsed
Previous Message Tom Lane 2002-04-08 19:43:51 Re: What's the difference?