Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id E51941337B47 for ; Tue, 4 Jan 2011 14:26:58 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 19670-01 for ; Tue, 4 Jan 2011 18:26:52 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 90E0E1337B4F for ; Tue, 4 Jan 2011 14:26:51 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id p04IQoW5012764; Tue, 4 Jan 2011 13:26:50 -0500 (EST) To: Gouse cc: pgsql-bugs@postgresql.org Subject: Re: to_timestamp returns the incorrect result for the DST fall over time. In-reply-to: <1294161425291-3327393.post@n5.nabble.com> References: <1294161425291-3327393.post@n5.nabble.com> Comments: In-reply-to Gouse message dated "Tue, 04 Jan 2011 09:17:05 -0800" Date: Tue, 04 Jan 2011 13:26:50 -0500 Message-ID: <12763.1294165610@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201101/12 X-Sequence-Number: 29034 Gouse writes: > I find that the to_timestamp giving the incorrect result for the DST time > period. On what grounds do you claim it's incorrect? > select to_timestamp('2010-03-28 01:00:03 243','YYYY-MM-DD HH24:MI:SS.MS') > results '2010-03-28 02:00:03.243 + 01' , I am not sure if this is correct. The reason it does that is that actually there *is* no such local time as 1:00:03 on that date. Clocks are supposed to jump from 1AM directly to 2AM. PG's actual behavior is that the bogus time is interpreted as standard time (UTC+0 in your case). The only other thing it could plausibly do is throw an error, and that has been judged to be less useful. regards, tom lane