Re: BUG #18445: date_part / extract range for hours do not match documentation

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #18445: date_part / extract range for hours do not match documentation
Дата
Msg-id 24615.1714162776@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: BUG #18445: date_part / extract range for hours do not match documentation  (Marek Läll <lall.marek@gmail.com>)
Список pgsql-bugs
=?UTF-8?Q?Marek_L=C3=A4ll?= <lall.marek@gmail.com> writes:
>> We tend not to introduce breaking changes if the only motivation is to be
>> consistent.

> Other mistakes are minor, but why is time '24:00:00' allowed, and it's
> actually 00:00:00 of the next day, that's something I'd like to read a
> well-argued design decision.

[ shrug... ]  You're about twenty-five years too late to argue about
this.

The SQL spec does say that the HOUR field of a time value should be
0-23, so allowing '24:00:00' is an extension, most likely decided by
Thomas Lockhart who wrote most of PG's datetime code to begin with.
He's long gone from the project and probably doesn't remember his
exact reasoning anyway.  But we're not likely to remove that extension
now, because there might be applications out there depending on it,
and it's quite unclear what it's hurting.  Arguing from principles
of consistency when discussing common timekeeping rules is pointless
anyway --- what in the world is consistent about any of it?

It could be that Thomas deemed this a more sensible representation
of '23:59:60', an input that's explicitly allowed by the SQL spec.
But that's just guessing.

            regards, tom lane



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

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: BUG #18445: date_part / extract range for hours do not match documentation
Следующее
От: Melanie Plageman
Дата:
Сообщение: Re: relfrozenxid may disagree with row XIDs after 1ccc1e05ae