Re: postgres UTC different from perl?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: postgres UTC different from perl?
Дата
Msg-id 1685.1198113257@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: postgres UTC different from perl?  (Richard Huxton <dev@archonet.com>)
Ответы Re: postgres UTC different from perl?
Список pgsql-general
Richard Huxton <dev@archonet.com> writes:
> I'm not sure that (CURRENT_DATE AT TIME ZONE 'UTC') does what you think
> it does. Try setting your timezone to various offsets and exploring.

In fact, I think it's adjusting in exactly the wrong direction.

I get the right number from

regression=# select date_part('epoch', 'today'::timestamp at time zone 'UTC');
 date_part
------------
 1198022400
(1 row)

and the wrong one from

regression=# select date_part('epoch', 'today'::timestamptz at time zone 'UTC');
 date_part
------------
 1198058400
(1 row)

and I think the locution with CURRENT_DATE is equivalent to the second
case because timestamptz is the preferred type to promote date to.

            regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: pgpool and slony
Следующее
От: Tatsuo Ishii
Дата:
Сообщение: Re: pgpool and slony