Re: Inconsistent behavior with TIMESTAMP WITHOUT and epoch

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Inconsistent behavior with TIMESTAMP WITHOUT and epoch
Дата
Msg-id 22819.1106852069@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Inconsistent behavior with TIMESTAMP WITHOUT and epoch  (Josh Berkus <josh@agliodbs.com>)
Ответы Re: Inconsistent behavior with TIMESTAMP WITHOUT and epoch  (Josh Berkus <josh@agliodbs.com>)
Список pgsql-bugs
Josh Berkus <josh@agliodbs.com> writes:
> The problem with the current functionality is that it makes it impossible to
> get a GMT Unix timestamp out of a TIMESTAMP WITHOUT TIME ZONE without string
> manipulation.

How so?  If you think that the timestamp-without-zone is relative to GMT
rather than your local zone, you say something like
    extract(epoch from (timestampvar AT TIME ZONE 'GMT'))

> And for an application where you want the timestamps to be
> location-agnostic (such as this one, with servers on east and west coasts,
> and some talk about London), you want your timestamps stored as GMT.

Quite honestly, you should be using timestamp WITH time zone for such an
application anyway.  The timestamp without zone datatype is very
strongly biased towards the assumption that the value is in your local
timezone, and if you've actually got multiple possible settings of
TimeZone then it's simply a great way to shoot yourself in the foot.

            regards, tom lane

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

Предыдущее
От: Michael Fuhr
Дата:
Сообщение: Re: [GENERAL] My postmaster just crashed !
Следующее
От: Tamas Vincze
Дата:
Сообщение: Re: 8.0.0 make check fails on Solaris 9 (sparc)