Re: unexpected behavior in combining timestamps with times zone and intervals - Mailing list pgsql-general

From Tom Lane
Subject Re: unexpected behavior in combining timestamps with times zone and intervals
Date
Msg-id 6005.1194154545@sss.pgh.pa.us
Whole thread Raw
In response to Re: unexpected behavior in combining timestamps with times zone and intervals  (Charles Seaton <cseaton@stccmop.org>)
List pgsql-general
Charles Seaton <cseaton@stccmop.org> writes:
> Thanks for your response. I am wondering whether it is postgres 8.2.5
> that resolves the problem or your time zone setting.

This behavior changed in PG 8.1.  Per the release notes:

* Add a separate day field to type interval so a one day interval can be
  distinguished from a 24 hour interval (Michael Glaesemann)

Days that contain a daylight saving time adjustment are not 24 hours
long, but typically 23 or 25 hours. This change creates a conceptual
distinction between intervals of "so many days" and intervals of "so
many hours". Adding 1 day to a timestamp now gives the same local time
on the next day even if a daylight saving time adjustment occurs
between, whereas adding 24 hours will give a different local time when
this happens. For example, under US DST rules:

        '2005-04-03 00:00:00-05' + '1 day' = '2005-04-04 00:00:00-04'
        '2005-04-03 00:00:00-05' + '24 hours' = '2005-04-04 01:00:00-04'

            regards, tom lane

pgsql-general by date:

Previous
From: Myshkin LeVine
Date:
Subject: Re: Problem starting the server with Mac OSX
Next
From: Kevin Hunter
Date:
Subject: Re: young guy wanting (Postgres DBA) ammo