BUG #15445: Difference between two dates is not an integer

Поиск
Список
Период
Сортировка
От PG Bug reporting form
Тема BUG #15445: Difference between two dates is not an integer
Дата
Msg-id 15445-f8f5a4e67e9eb3d4@postgresql.org
обсуждение исходный текст
Ответы Re: BUG #15445: Difference between two dates is not an integer  (Sergei Kornilov <sk@zsrv.org>)
Список pgsql-bugs
The following bug has been logged on the website:

Bug reference:      15445
Logged by:          Martin Varady
Email address:      martin.varady@gmail.com
PostgreSQL version: 10.4
Operating system:   Windows Server 2012
Description:

I've been using Postgres 9.3 and am recently testing moving to Postgres 10.
Testing Postgres 10 I've noticed that the difference between two dates gives
me an interval when it is documented as giving a integer. This is how it
worked in Postgres 9.3.

From Documentation of Postgres 10:
https://www.postgresql.org/docs/10/static/functions-datetime.html
date '2001-10-01' - date '2001-09-28'     integer '3' (days)

Test Case:
I'm casting the result to an int to prove my point.
select (date '2001-10-01' - date '2001-09-28')::int
In Postgres 9.3 provides a result of 3 Integer type
In Postgres 10 gives error:

ERROR:  cannot cast type interval to integer
LINE 1: select (date '2001-10-01' - date '2001-09-28')::int
                                                      ^
SQL state: 42846
Character: 47


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

Предыдущее
От: PG Bug reporting form
Дата:
Сообщение: BUG #15444: Problem running post-install step autostart
Следующее
От: Sergei Kornilov
Дата:
Сообщение: Re: BUG #15445: Difference between two dates is not an integer