Re: interval integer comparison

Поиск
Список
Период
Сортировка
От Bruno Wolff III
Тема Re: interval integer comparison
Дата
Msg-id 20050602122632.GA6785@wolff.to
обсуждение исходный текст
Ответ на Re: interval integer comparison  (Havasvölgyi Ottó <h.otto@freemail.hu>)
Список pgsql-general
On Thu, Jun 02, 2005 at 13:26:32 +0200,
  Havasvölgyi Ottó <h.otto@freemail.hu> wrote:
>
> I tried to simulate this unexpected result, but with no success. Here in
> Hungary we had daylight saving this year on the 27th of March
> (http://webexhibits.org/daylightsaving/b.html). So I tried these:
>
> select '2005-03-28'::date - '1 day'::interval;
> select '2005-03-28'::timestamp - '1 day'::interval;
> select '2005-03-28'::date - '24 hour'::interval;
> select '2005-03-28'::timestamp - '24 hour'::interval;
>
> Each of the results were the same: 2005-03-27 00:00:00
>
> I tried with a larger interval too but I didn't experience any shift in
> hours. By the way, I use PG 8.0.3 on WinXP SP1, I just experiment with
> Postgres.

I double checked and the promotion is to TIMESTAMP WITHOUT TIME ZONE so
so daylight savings won't in fact be a problem.

However, subtracting an integer will avoid the conversion and should
run slightly faster.

В списке pgsql-general по дате отправления:

Предыдущее
От: "Dinesh Pandey"
Дата:
Сообщение: Re: [SQL] index row size 2728 exceeds btree maximum, 2713
Следующее
От: Bruno Wolff III
Дата:
Сообщение: Re: index row size 2728 exceeds btree maximum, 27