<div><br /></div><div><br /></div><div>-------- Пересылаемое сообщение--------</div><div>11.10.2017, 17:12, "Pavel Stehule" <pavel(dot)stehule(at)gmail(dot)com>:</div><div><br /></div><div><div dir="ltr">Hi<br /><div><div><br /><div><span>2017-10-11 12</span>:35 GMT+02:00 <span dir="ltr"><<a href="mailto:kes-kes(at)yandex(dot)ru" target="_blank">kes-kes(at)yandex(dot)ru</a>></span>:<br /><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex;">The following bug has been logged on the website:<br />
<br />
Bug reference: 14850<br />
Logged by: Eugen Konkov<br />
Email address: <a href="mailto:kes-kes(at)yandex(dot)ru">kes-kes(at)yandex(dot)ru</a><br />
PostgreSQL version: 10.0<br />
Operating system: Linux mint 18: Linux work 4.4.0-57-generic #78-Ubu<br />
Description:<br />
<br />
Hi. I try to do next math:<br />
<br />
select extract( month from justify_days( timestamp '<span>2016-01-31</span>' +interval '1<br />
month' -timestamp '<span>2016-01-31</span>') );<br />
date_part<br />
-----------<br />
0<br />
(1 row)<br />
<br />
I expect `1` but get `0`. But here everything is right:<br />
<br />
>Adjust interval so 30-day time periods are represented as months<br />
<br />
<a href="https://www.postgresql.org/docs/9.6/static/functions-datetime.html" rel="noreferrer" target="_blank">https://www.postgresql.org/<wbr />docs/9.6/static/functions-<wbr />datetime.html</a><br />
<br />
But with ability to setup justify date the math will be more sharp.<br />
<br />
Please implement next feature:<br />
<br />
select extract( month from justify_days( timestamp '<span>2016-01-31</span>' +interval '1<br />
month' -timestamp '<span>2016-01-31</span>'), timestamp '<span>2016-01-31</span>' );<br />
date_part<br />
-----------<br />
1<br />
(1 row)<br />
<br />
This is useful when I try to calculate how much month are left between<br />
service start and end dates.<br /></blockquote><div><br /></div><div>This is not the bug, so pgsql-hackers, pgsql-general are better places for this discussion <br /></div><div><br /></div><div>I am thinking so your request has sense, and should be registered in ToDo list <a href="https://wiki.postgresql.org/wiki/Todo">https://wiki.postgresql.org/wiki/Todo</a></div><div><br /></div><div>You can try to connect people from PostgreSQL Pro company for implementation.</div><div><br /></div><div>Regards</div><div><br /></div><div>Pavel</div><div><br /></div><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex;">
<br />
Thank you.<br />
<span><font color="#888888"><br />
<br />
--<br />
Sent via pgsql-bugs mailing list (<a href="mailto:pgsql-bugs(at)postgresql(dot)org">pgsql-bugs(at)postgresql(dot)org</a>)<br />
To make changes to your subscription:<br />
<a href="http://www.postgresql.org/mailpref/pgsql-bugs" rel="noreferrer" target="_blank">http://www.postgresql.org/<wbr />mailpref/pgsql-bugs</a><br />
</font></span></blockquote></div><br /></div></div></div>
</div><div><br /></div><div>-------- Конец пересылаемого сообщения --------</div>