Division of intervals.

Поиск
Список
Период
Сортировка
От Joshua Moore-Oliva
Тема Division of intervals.
Дата
Msg-id 200303181932.48369.josh@chatgris.com
обсуждение исходный текст
Ответы Re: Division of intervals.  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Attempting rather unsuccessfully to convert something of the form

45 years 9 mons 5 days 20:28:18.886891

to a total number of months, I attempted

SELECT age(now(), timestamp '1957-06-13') / interval '1 month';

and got the error

ERROR:  Unable to identify an operator '/' for types 'interval' and 'interval'
        You will have to retype this query using an explicit cast


Does anyone know what interval format intervals are stored as?  Is there a way
I can cast this expression to be able to find the number of months within
this interval?

Or is there a function I don't know about capable of doing this? (extracting
the total number of a specific interval from another interval)...  e.g. total
number of months, total number of days...

Josh.

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

Предыдущее
От: James Gregory
Дата:
Сообщение: Re: Referential Integrity problem
Следующее
От: Stephan Szabo
Дата:
Сообщение: Re: Referential Integrity problem