BUG #18445: date_part / extract range for hours do not match documentation
От
PG Bug reporting form
Тема
BUG #18445: date_part / extract range for hours do not match documentation
Дата
Msg-id
18445-2bdf6f3c730abe6d@postgresql.org
Список
Дерево обсуждения
BUG #18445: date_part / extract range for hours do not match documentation PG Bug reporting form <noreply@postgresql.org>
Re: BUG #18445: date_part / extract range for hours do not match documentation Tom Lane <tgl@sss.pgh.pa.us>
Re: BUG #18445: date_part / extract range for hours do not match documentation Marek Läll <lall.marek@gmail.com>
Re: BUG #18445: date_part / extract range for hours do not match documentation "David G. Johnston" <david.g.johnston@gmail.com>
Re: BUG #18445: date_part / extract range for hours do not match documentation Marek Läll <lall.marek@gmail.com>
Re: BUG #18445: date_part / extract range for hours do not match documentation Tom Lane <tgl@sss.pgh.pa.us>
Re: BUG #18445: date_part / extract range for hours do not match documentation "David G. Johnston" <david.g.johnston@gmail.com>
The following bug has been logged on the website:
Bug reference: 18445
Logged by: Filipe Caldas
Email address: fcaldasdesou@bloomberg.net
PostgreSQL version: 14.11
Operating system: Linux (RHEL 8)
Description:
In https://www.postgresql.org/docs/8.1/functions-datetime.html
We say that EXTRACT() should return a number between 0-23 for hours
hour
The hour field (0 - 23)
SELECT EXTRACT(HOUR FROM TIMESTAMP '2001-02-16 20:38:40');
Result: 20
The function seems to also return 24 in some cases eg:
SELECT date_part('hour', cast('24:00:00.00' as time))::int
Could we update the documentation or modify the function so that it wraps 24
back to 0 hours?
Thanks
В списке pgsql-bugs по дате отправления
От: Tender Wang
Дата: