Re: Exclusion constraints with time expressions

From: Jasen Betts <jasen(at)xnet(dot)co(dot)nz>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Exclusion constraints with time expressions
Date: 2012-11-18 02:15:39
Message-ID: k89gcb$4jo$1@reversiblemaps.ath.cx
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 2012-11-06, Kevin Grittner <kgrittn(at)mail(dot)com> wrote:
> hari(dot)fuchs(at)gmail(dot)com
>
>> No: the result of e.g.
>>
>>  SELECT TIMESTAMPTZ '2012-10-28 01:30:00' + INTERVAL '24 hours';
>>
>> depends on the client's timezone and its DST rules.
>
> Can you give an example of where adding an interval based on *hours*
> to TIMESTAMP WITH TIME ZONE would give a different value based on
> client's time zone and DST rules? If there is such a case, we have a
> bug, IMO.

the problem is with the value of TIMESTAMPTZ '2012-10-28 01:30:00'
more than how the addition is handled.

> Now, if you wanted to argue that *this* query might depend on time
> zone information, I'd be more willing to believe it, and maybe the
> problem is that we use the same function for both:
>
> SELECT TIMESTAMPTZ '2012-10-28 01:30:00' + INTERVAL '1 day';

even done right (with a timezone in the left argument) that one's
going to be locale dependant.

--
⚂⚃ 100% natural

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jasen Betts 2012-11-18 02:27:54 Re: Exclusion constraints with time expressions
Previous Message Phil Sorber 2012-11-18 02:12:44 Prepared Statement Name Truncation