Re: to_char function has Daylight Savings Bug - Mailing list pgsql-bugs

From Tom Lane
Subject Re: to_char function has Daylight Savings Bug
Date
Msg-id 10391.1053019573@sss.pgh.pa.us
Whole thread Raw
In response to to_char function has Daylight Savings Bug  (Dana Burd <DBurd@cpr.org>)
List pgsql-bugs
Dana Burd <DBurd@cpr.org> writes:
> to_char(timestamp, 'SSSS') has a Daylight Savings bug.  It includes the
> missing 2am hour in it's "seconds from midnight count" for DST begin day
> (4/6/2003), and does not include the extra hour for DST end day
> (10/26/2003).

It's not readily apparent to me that this is a bug.  The SSSS value is
evidently being calculated as HH*3600+MM*60+SS, so it corresponds to the
nominal time of 3:00:00 AM.  I think it would be rather surprising if
SSSS *didn't* correspond to HH:MM:SS.

However, to_char() is intended to slavishly imitate Oracle's to_char(),
warts and all.  What does Oracle do with this situation?

            regards, tom lane

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: segfault in postmaster (pg 7.3.2 & FreeBSD)
Next
From: Andreas Schmitz
Date:
Subject: UPDATE has a bug to update tables with an index of 2 columns