Re: Incorrect handling of timezones with extract

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Incorrect handling of timezones with extract
Date: 2013-03-12 07:32:57
Message-ID: CAB7nPqTaqL5c2ZAGnhHuHaAjmygcbOPYaAdrR5Rx_YrnzT9z7A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Mar 12, 2013 at 3:11 PM, Michael Paquier
<michael(dot)paquier(at)gmail(dot)com>wrote:

> postgres=# select extract(day from ((CAST(-3 || 'day' as interval)+now())
> - now()));
> date_part
> -----------
> -2
> (1 row)
> Here I believe that the correct result should be -3.
>
Note that it passes with values upper than -2 and lower than -127:
> Also note that this happens only with the timezone set where time -1day.
>
Sorry for the noise, I found the same question answered here:
http://www.postgresql.org/message-id/17307.1021949260@sss.pgh.pa.us
This is due to the fact that US/Pacific moved to DST last weekend.
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Smith 2013-03-12 09:06:36 Re: Proposal for Allow postgresql.conf values to be changed via SQL [review]
Previous Message Etsuro Fujita 2013-03-12 06:35:22 Fix document typo