Re: Intervals and ISO 8601 duration

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: Intervals and ISO 8601 duration
Дата
Msg-id CAKFQuwau=8wMaqpZCxwtUyrXsd6mojrWSMrE+2oeyWHrxM35UQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Intervals and ISO 8601 duration  (Adrian Klaver <adrian.klaver@aklaver.com>)
Список pgsql-general
On Fri, Jan 13, 2023 at 3:41 PM Adrian Klaver <adrian.klaver@aklaver.com> wrote:
On 1/13/23 14:17, Ken Tanzer wrote:
> On Thu, Jan 12, 2023 at 7:08 AM Tom Lane <tgl@sss.pgh.pa.us
> <mailto:tgl@sss.pgh.pa.us>> wrote:
>
>     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?
>
> (I'm asking because of an issue that came up about intervals that were
> "equal but not identical.")

1) Can you provide an example?

2) I don't know how to reverse an output interval to it's input value.


That wasn't the ask though:

select interval '2 year 36 hours 15.123456789 seconds';
yields:
2 years 36:00:15.123457

But if what is stored is only months, days, and microseconds what is being requested is to produce:

24 months 1.5 days 15123457 microseconds (or whatever the values stored in those three positions is...)

David J.


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

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