X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 8BD4BD1B518 for ; Tue, 2 Dec 2003 05:09:53 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 53171-02 for ; Tue, 2 Dec 2003 01:09:22 -0400 (AST) Received: from h-e.com (h-68-166-219-83.SNVACAID.covad.net [68.166.219.83]) by svr1.postgresql.org (Postfix) with ESMTP id 1FFAFD1BC5C for ; Tue, 2 Dec 2003 01:09:21 -0400 (AST) Received: from [192.168.42.42] (HELO h-e.com) by h-e.com (CommuniGate Pro SMTP 3.5.9) with ESMTP id 420835 for pgsql-sql@postgresql.org; Mon, 01 Dec 2003 21:09:20 -0800 Date: Mon, 1 Dec 2003 21:09:20 -0800 Mime-Version: 1.0 (Apple Message framework v552) Content-Type: text/plain; charset=US-ASCII; format=flowed Subject: Problem with intervals From: Bob Smith To: pgsql-sql Content-Transfer-Encoding: 7bit Message-Id: X-Mailer: Apple Mail (2.552) X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200312/8 X-Sequence-Number: 16174 I'm getting an unexpected result using intervals in an expression: select ('2003-10-26 0:00:00'::timestamp + '1 day'::interval)::date; date ------------ 2003-10-26 (1 row) When I get rid of the date cast it becomes clear what is happening: select '2003-10-26 0:00:00'::timestamp + '1 day'::interval; ?column? ------------------------ 2003-10-26 23:00:00-08 (1 row) I assumed '1 day' would always increment the date by 1, but it appears that '1 day' just means '24 hours', and due to the daylight/standard time shift, October 26 was 25 hours long this year. Is this a Postgres bug, or is this correct SQL behavior? I'm running Postgres 7.2.2. Bob S.