Re: Intervals and ISO 8601 duration

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Intervals and ISO 8601 duration
Дата
Msg-id 892688.1673657835@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Intervals and ISO 8601 duration  (Ken Tanzer <ken.tanzer@gmail.com>)
Ответы Re: Intervals and ISO 8601 duration  (Ken Tanzer <ken.tanzer@gmail.com>)
Список pgsql-general
Ken Tanzer <ken.tanzer@gmail.com> writes:
> Not really.  My original question was:
>> [since intervals are stored internally as months, days and microseconds...]
>> What Postgres actually stores for an interval is three fields:
>> months, days, and microseconds.
>> *Is there a way to view/extract this raw data for any given interval?*

Given what extract() provides,

stored months = years * 12 + months

stored days = days

stored usec = reconstruct from hours+minutes+seconds+microseconds

Perhaps it wouldn't be a bad idea to provide a couple more extract()
keywords to make that easier.

            regards, tom lane



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

Предыдущее
От: Ken Tanzer
Дата:
Сообщение: Re: Intervals and ISO 8601 duration
Следующее
От: Ken Tanzer
Дата:
Сообщение: Re: Intervals and ISO 8601 duration