Re: How to convert a UnixTimestamp to a PostgreSQL date without using ::abstime ?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: How to convert a UnixTimestamp to a PostgreSQL date without using ::abstime ?
Дата
Msg-id 26997.1063165265@sss.pgh.pa.us
обсуждение исходный текст
Ответ на How to convert a UnixTimestamp to a PostgreSQL date without using ::abstime ?  ("Bruno BAGUETTE" <pgsql-ml@baguette.net>)
Ответы RE : How to convert a UnixTimestamp to a PostgreSQL date without using ::abstime ?  ("Bruno BAGUETTE" <pgsql-ml@baguette.net>)
RE : How to convert a UnixTimestamp to a PostgreSQL date without using ::abstime ?  ("Bruno BAGUETTE" <bouchon.web@baguette.net>)
Список pgsql-general
"Bruno BAGUETTE" <pgsql-ml@baguette.net> writes:
> I'm looking for a way to convert a unix timestamp to a PostgreSQL date
> without using ::abstime which seems to be deprecated.

abstime is not yet deprecated in my mind, precisely because it's still
the easiest way to do the reverse of "extract(epoch from timestamp)".
The cleanest alternative I know of is

select 'epoch'::timestamptz + (unixtimestamphere) * '1 sec'::interval;

but this still leaves an unsatisfied feeling.  Sooner or later we'll
probably invent an explicit function to do this conversion.

            regards, tom lane

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

Предыдущее
От: "Marc G. Fournier"
Дата:
Сообщение: Re: State of Beta 2
Следующее
От: Jan Wieck
Дата:
Сообщение: Re: Replaceing records