Re: BUG #1993: Adding/subtracting negative time intervals

From: Andrew - Supernews <andrew+nonews(at)supernews(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #1993: Adding/subtracting negative time intervals
Date: 2005-10-26 07:32:57
Message-ID: slrndluc99.g61.andrew+nonews@trinity.supernews.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

On 2005-10-26, Klint Gore <kg(at)kgb(dot)une(dot)edu(dot)au> wrote:
> [sorry about the previous email, I quoted the wrong bit and clicked the
> wrong button]
>
> On Tue, 25 Oct 2005 23:41:54 -0400 (EDT), Bruce Momjian
><pgman(at)candle(dot)pha(dot)pa(dot)us> wrote:
>> test=> select
>> test-> ('2005-10-30 13:22:00-05'::timestamptz -
>> test(> '2005-10-29 13:22:00-04'::timestamptz);
>> ?column?
>> ----------
>> 25:00:00
>> (1 row)
>
> Is that actually the correct answer?

Absolutely.

> Disregarding daylight savings, there is 25hrs between them. Once
> daylight savings is taken into account there should be 24 or 26 hours
> between them (southern/northern hemisphere respectively).
>
> Or have I missed something obvious?

Yes. The difference between those two times is exactly the same whatever
timezone the person running the query is in, because they are _completely
specified_ by the input. That difference is 25 hours. There are no
circumstances in which that difference could ever be 24 or 26 hours
regardless of what timezone the user is in. (The only way in which the
timezone makes a difference is that a user in US/Eastern might, under
some circumstances, wish to regard that time period as '1 day' rather
than 25 hours; no user in any other timezone would do so. Since the
conversion from '25 hours' to '1 day' loses information, it should not
happen.)

--
Andrew, Supernews
http://www.supernews.com - individual and corporate NNTP services

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Telin Lin 2005-10-26 08:27:52 BUG #2001: Signal 11 after concurrent inserts + updates
Previous Message Andrew - Supernews 2005-10-26 07:02:39 Re: BUG #1993: Adding/subtracting negative time intervals

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2005-10-26 12:31:41 Re: BUG #1993: Adding/subtracting negative time intervals
Previous Message Andrew - Supernews 2005-10-26 07:02:39 Re: BUG #1993: Adding/subtracting negative time intervals