Re: Trouble with UNIX TimeStamps

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Trouble with UNIX TimeStamps
Дата
Msg-id 25769.1041014398@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Trouble with UNIX TimeStamps  ("Jonathan Chum" <jchum@aismedia.com>)
Список pgsql-general
"Jonathan Chum" <jchum@aismedia.com> writes:
> ERROR:  Cannot cast type integer to timestamp with time zone

A solution with less notational cruft is to cast the integer to abstime:

regression=# select 1040999196::abstime;
        abstime
------------------------
 2002-12-27 09:26:36-05
(1 row)

regression=# select to_char(1040999196::abstime, 'Day');
  to_char
-----------
 Friday
(1 row)

abstime is a deprecated datatype if you believe the manual, but I
seriously doubt that we'll remove it anytime soon.  Maybe when Y2038
is upon us (by which time you'd better have found another representation
for your table, anyway).

            regards, tom lane

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

Предыдущее
От: Ben
Дата:
Сообщение: Re: Trouble with UNIX TimeStamps
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: Storing passwords