pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #6340: to_timestamp() miscalculates
6+ messages / 5 participants
[nested] [flat]

* BUG #6340: to_timestamp() miscalculates
@ 2011-12-15 15:51 hfuxelius@gmail.com
  2011-12-15 16:16 ` Re: BUG #6340: to_timestamp() miscalculates Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 6+ messages in thread

From: hfuxelius@gmail.com @ 2011-12-15 15:51 UTC (permalink / raw)
  To: pgsql-bugs

The following bug has been logged on the website:

Bug reference:      6340
Logged by:          Hans-Henrik Fuxelius
Email address:      hfuxelius@gmail.com
PostgreSQL version: 9.1.1
Operating system:   Ubuntu 11.10
Description:        

test to run: select to_timestamp('2011,03,27,02,11,11',
'YYYY,MM,DD,HH24,MI,SS')

and the run: select to_timestamp('2011,03,27,03,11,11',
'YYYY,MM,DD,HH24,MI,SS')

It miscalculates 02 hour to 03 hour by some reason




^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: BUG #6340: to_timestamp() miscalculates
  2011-12-15 15:51 BUG #6340: to_timestamp() miscalculates hfuxelius@gmail.com
@ 2011-12-15 16:16 ` Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2011-12-15 16:16 UTC (permalink / raw)
  To: hfuxelius@gmail.com; +Cc: pgsql-bugs

hfuxelius@gmail.com writes:
> test to run: select to_timestamp('2011,03,27,02,11,11',
> 'YYYY,MM,DD,HH24,MI,SS')

> and the run: select to_timestamp('2011,03,27,03,11,11',
> 'YYYY,MM,DD,HH24,MI,SS')

> It miscalculates 02 hour to 03 hour by some reason

If that date is a DST forward transition date in your timezone, then
this behavior is neither surprising nor a bug.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: BUG #6340: to_timestamp() miscalculates
@ 2011-12-15 16:20 Kevin Grittner <Kevin.Grittner@wicourts.gov>
  2011-12-15 16:56 ` Re: BUG #6340: to_timestamp() miscalculates Hans-Henrik Fuxelius <hfuxelius@gmail.com>
  0 siblings, 1 reply; 6+ messages in thread

From: Kevin Grittner @ 2011-12-15 16:20 UTC (permalink / raw)
  To: hfuxelius@gmail.com; pgsql-bugs

wrote:
 
> test to run: select to_timestamp('2011,03,27,02,11,11',
> 'YYYY,MM,DD,HH24,MI,SS')
> 
> and the run: select to_timestamp('2011,03,27,03,11,11',
> 'YYYY,MM,DD,HH24,MI,SS')
> 
> It miscalculates 02 hour to 03 hour by some reason
 
I don't know what time zone you're in, or whether daylight saving
time kicks in on that date.  *Is* there a 02:11:11 on that date, or
is that when time "springs forward" by an hour in the spring for your
locale?
 
-Kevin



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: BUG #6340: to_timestamp() miscalculates
  2011-12-15 16:20 Re: BUG #6340: to_timestamp() miscalculates Kevin Grittner <Kevin.Grittner@wicourts.gov>
@ 2011-12-15 16:56 ` Hans-Henrik Fuxelius <hfuxelius@gmail.com>
  2011-12-16 08:43   ` Re: BUG #6340: to_timestamp() miscalculates Hans-Henrik Fuxelius <hfuxelius@gmail.com>
  0 siblings, 1 reply; 6+ messages in thread

From: Hans-Henrik Fuxelius @ 2011-12-15 16:56 UTC (permalink / raw)
  To: Kevin Grittner <Kevin.Grittner@wicourts.gov>; +Cc: pgsql-bugs

Thanx a lot for your promt respons :) You are absolutely right, its the daylight saving that date and hour, I had it as an key in my GPS data and was very confused!!!

Again - Thanx
/Hans-Henrik
On Dec 15, 2011, at 5:20 PM, Kevin Grittner wrote:

> wrote:
> 
>> test to run: select to_timestamp('2011,03,27,02,11,11',
>> 'YYYY,MM,DD,HH24,MI,SS')
>> 
>> and the run: select to_timestamp('2011,03,27,03,11,11',
>> 'YYYY,MM,DD,HH24,MI,SS')
>> 
>> It miscalculates 02 hour to 03 hour by some reason
> 
> I don't know what time zone you're in, or whether daylight saving
> time kicks in on that date.  *Is* there a 02:11:11 on that date, or
> is that when time "springs forward" by an hour in the spring for your
> locale?
> 
> -Kevin




^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: BUG #6340: to_timestamp() miscalculates
  2011-12-15 16:20 Re: BUG #6340: to_timestamp() miscalculates Kevin Grittner <Kevin.Grittner@wicourts.gov>
  2011-12-15 16:56 ` Re: BUG #6340: to_timestamp() miscalculates Hans-Henrik Fuxelius <hfuxelius@gmail.com>
@ 2011-12-16 08:43   ` Hans-Henrik Fuxelius <hfuxelius@gmail.com>
  2011-12-23 17:25     ` Re: BUG #6340: to_timestamp() miscalculates Robert Haas <robertmhaas@gmail.com>
  0 siblings, 1 reply; 6+ messages in thread

From: Hans-Henrik Fuxelius @ 2011-12-16 08:43 UTC (permalink / raw)
  To: Kevin Grittner <Kevin.Grittner@wicourts.gov>; +Cc: pgsql-bugs

It seems not possible to suppress to_timestamp from doing daylight
saving conversion, I have GPS timeseries that looks perfect in the
'timestamp without time zone' save one value that wreck the whole time
serie, does that mean that time series cant be stored in time stamps?

/Hans-Henrik

On Thu, Dec 15, 2011 at 5:56 PM, Hans-Henrik Fuxelius
<hfuxelius@gmail.com> wrote:
> Thanx a lot for your promt respons :) You are absolutely right, its the daylight saving that date and hour, I had it as an key in my GPS data and was very confused!!!
>
> Again - Thanx
> /Hans-Henrik
> On Dec 15, 2011, at 5:20 PM, Kevin Grittner wrote:
>
>> wrote:
>>
>>> test to run: select to_timestamp('2011,03,27,02,11,11',
>>> 'YYYY,MM,DD,HH24,MI,SS')
>>>
>>> and the run: select to_timestamp('2011,03,27,03,11,11',
>>> 'YYYY,MM,DD,HH24,MI,SS')
>>>
>>> It miscalculates 02 hour to 03 hour by some reason
>>
>> I don't know what time zone you're in, or whether daylight saving
>> time kicks in on that date.  *Is* there a 02:11:11 on that date, or
>> is that when time "springs forward" by an hour in the spring for your
>> locale?
>>
>> -Kevin
>



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: BUG #6340: to_timestamp() miscalculates
  2011-12-15 16:20 Re: BUG #6340: to_timestamp() miscalculates Kevin Grittner <Kevin.Grittner@wicourts.gov>
  2011-12-15 16:56 ` Re: BUG #6340: to_timestamp() miscalculates Hans-Henrik Fuxelius <hfuxelius@gmail.com>
  2011-12-16 08:43   ` Re: BUG #6340: to_timestamp() miscalculates Hans-Henrik Fuxelius <hfuxelius@gmail.com>
@ 2011-12-23 17:25     ` Robert Haas <robertmhaas@gmail.com>
  0 siblings, 0 replies; 6+ messages in thread

From: Robert Haas @ 2011-12-23 17:25 UTC (permalink / raw)
  To: Hans-Henrik Fuxelius <hfuxelius@gmail.com>; +Cc: Kevin Grittner <Kevin.Grittner@wicourts.gov>; pgsql-bugs

On Fri, Dec 16, 2011 at 3:43 AM, Hans-Henrik Fuxelius
<hfuxelius@gmail.com> wrote:
> It seems not possible to suppress to_timestamp from doing daylight
> saving conversion, I have GPS timeseries that looks perfect in the
> 'timestamp without time zone' save one value that wreck the whole time
> serie, does that mean that time series cant be stored in time stamps?

I think it mostly means that you shouldn't use timestamp without time zone.

Or else you should use a time zone setting that doesn't involve DST.

Throwing away the time zone information is bad, because YYYY-MM-DD
HH:MM:SS doesn't uniquely identify a point in time, even if you know
what time zone it's relative to.  That combination of years, minutes,
days, hours, minutes, and seconds can occur twice, if it's near a DST
boundary.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



^ permalink  raw  reply  [nested|flat] 6+ messages in thread


end of thread, other threads:[~2011-12-23 17:25 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2011-12-15 15:51 BUG #6340: to_timestamp() miscalculates hfuxelius@gmail.com
2011-12-15 16:16 ` Tom Lane <tgl@sss.pgh.pa.us>
2011-12-15 16:20 Re: BUG #6340: to_timestamp() miscalculates Kevin Grittner <Kevin.Grittner@wicourts.gov>
2011-12-15 16:56 ` Hans-Henrik Fuxelius <hfuxelius@gmail.com>
2011-12-16 08:43   ` Hans-Henrik Fuxelius <hfuxelius@gmail.com>
2011-12-23 17:25     ` Robert Haas <robertmhaas@gmail.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox