Re: date time function

Поиск
Список
Период
Сортировка
От Michael Glaesemann
Тема Re: date time function
Дата
Msg-id C14E553E-F904-41EE-A226-22CED48C6FD0@seespotcode.net
обсуждение исходный текст
Ответ на Re: date time function  (Raymond O'Donnell <rod@iol.ie>)
Ответы Re: date time function  ("John D. Burger" <john@mitre.org>)
Список pgsql-general
On Jun 28, 2007, at 15:13 , Raymond O'Donnell wrote:

> Cast your result to type INTERVAL - something like this:
>
> postgres=# select (current_timestamp - timestamp
> '2007-05-01')::interval;
>
>        interval
> ----------------------
>  58 days 21:10:36.748
> (1 row)

The cast to interval is superfluous: timestamp - timestamp already
gives you an interval result. Also, Postgres will interpret
'2007-05-01' as a date in this context:

# select current_timestamp - '2007-05-01';
         ?column?
-------------------------
58 days 16:25:53.776695
(1 row)

Michael Glaesemann
grzm seespotcode net



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

Предыдущее
От: Raymond O'Donnell
Дата:
Сообщение: Re: date time function
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: AutoVacuum Behaviour Question