Re: Can we consider "24 Hours" for "next day" in INTERVAL datatype ?

Поиск
Список
Период
Сортировка
От Joseph Koshakow
Тема Re: Can we consider "24 Hours" for "next day" in INTERVAL datatype ?
Дата
Msg-id CAAvxfHeFRdMb9uV_UMfKAoPYNqSs6njK6gvRaT03CPCvG0ZEEg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Can we consider "24 Hours" for "next day" in INTERVAL datatype ?  (Julien Rouhaud <rjuju123@gmail.com>)
Список pgsql-hackers
On Tue, Mar 15, 2022 at 3:46 AM Julien Rouhaud <rjuju123@gmail.com> wrote:
> On Tue, Mar 15, 2022 at 12:54:58PM +0530, Prabhat Sahu wrote:
> >
> > Is there any specific purpose we are holding the hours as an increasing
> > number beyond 24 hours also?
>
> Yes, you can't blindly assume that adding 24 hours will always be the same as
> adding a day.  You can just justify_days if you want to force that behavior.

The specific purpose by the way, at least according to the docs [1],
is daylights savings time:
> Internally interval values are stored as months, days, and microseconds. This is done because
> the number of days in a month varies, and a day can have 23 or 25 hours if a daylight savings
> time adjustment is involved.
Though I suppose leap seconds may also follow similar logic.

[1] https://www.postgresql.org/docs/current/datatype-datetime.html#DATATYPE-INTERVAL-INPUT

- Joe Koshakow



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

Предыдущее
От: Justin Pryzby
Дата:
Сообщение: Re: Assert in pageinspect with NULL pages
Следующее
От: Julien Rouhaud
Дата:
Сообщение: Re: Change the csv log to 'key:value' to facilitate the user to understanding and processing of logs