Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id CDE1D4759A8; Mon, 20 May 2002 22:47:54 -0400 (EDT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id A8A5647599B; Mon, 20 May 2002 22:47:53 -0400 (EDT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.4/8.11.4) with ESMTP id g4L2lfW17310; Mon, 20 May 2002 22:47:41 -0400 (EDT) To: josh@agliodbs.com Cc: pgsql-sql@postgresql.org, pgsql-bugs@postgresql.org Subject: Re: [SQL] Bug with Daylight Savings Time & Interval In-reply-to: <200205201534.32937.josh@agliodbs.com> References: <200205201534.32937.josh@agliodbs.com> Comments: In-reply-to Josh Berkus message dated "Mon, 20 May 2002 15:34:32 -0700" Date: Mon, 20 May 2002 22:47:40 -0400 Message-ID: <17307.1021949260@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200205/95 X-Sequence-Number: 3702 Josh Berkus writes: > Found this interesting bug: > 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 This isn't a bug per the existing definition of INTERVAL. '250 days' is defined as '250*24 hours', exactly, no more no less. When you move across a DST boundary you get behavior like the above. I've opined several times that interval should account for three separate units: months, days, and seconds. But our time-meister Tom Lockhart doesn't seem to have taken any interest in the idea. regards, tom lane