Skip site navigation (1) Skip section navigation (2)

Bug with Daylight Savings Time & Interval

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Bug with Daylight Savings Time & Interval
Date: 2002-05-20 22:34:32
Message-ID: 200205201534.32937.josh@agliodbs.com (view raw or flat)
Thread:
Lists: pgsql-bugspgsql-hackerspgsql-sql
Folks,

Found this interesting bug:

jwnet=> select version();
                            version
---------------------------------------------------------------
 PostgreSQL 7.2.1 on i686-pc-linux-gnu, compiled by GCC 2.95.3
(1 row)

jwnet=> select ('2001-07-31 10:00:00 PST'::TIMESTAMP) + ('248 days'::INTERVAL) 
;
        ?column?
------------------------
 2002-04-05 10:00:00-08
(1 row)

jwnet=> select ('2001-07-31 10:00:00 PST'::TIMESTAMP) + ('249 days'::INTERVAL) 
;
        ?column?
------------------------
 2002-04-06 10:00:00-08
(1 row)

jwnet=> select ('2001-07-31 10:00:00 PST'::TIMESTAMP) + ('250 days'::INTERVAL) 
;
        ?column?
------------------------
 2002-04-07 11:00:00-07

jwnet=> select ('2001-04-01 10:00:00 PST'::TIMESTAMP) + ('100 days'::INTERVAL) 
;
        ?column?
------------------------
 2001-07-10 11:00:00-07


It appears that Spring Daylight Savings Time causes PostgreSQL to change my 
time zone.  Only the spring, mind you, and not the fall.   This is 
potentially catastrophic for the application I'm developing; what can I do to 
see that it's fixed?  Or am I misunderstanding the behavior, here?

-- 
-Josh Berkus

P.S. I'm posting this here instead of the online bug form because I know that 
Bruce is on vacation.



Responses

pgsql-hackers by date

Next:From: Bruce MomjianDate: 2002-05-20 22:45:59
Subject: I am online today
Previous:From: markirDate: 2002-05-20 21:37:17
Subject: Re: Unbounded (Possibly) Database Size Increase - Toasting

pgsql-bugs by date

Next:From: Tom LaneDate: 2002-05-21 02:47:40
Subject: Re: [SQL] Bug with Daylight Savings Time & Interval
Previous:From: pgsql-bugsDate: 2002-05-20 20:18:05
Subject: Bug #669: gawk: cmd. line:2: (END OF FILE)

pgsql-sql by date

Next:From: Joel BurtonDate: 2002-05-21 00:21:53
Subject: Re: [SQL] Guarantee uniqueness of PGP key
Previous:From: andreDate: 2002-05-20 20:17:09
Subject: Guarantee uniqueness of PGP key

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group