Fwd: [BUGS] BUG #14850: Implement optinal additinal parameter for 'justify' date/time function

From: KES <kes-kes(at)yandex(dot)ru>
To: pgsql-hackers(at)postgresql(dot)org, pgsql-general(at)postgresql(dot)org
Subject: Fwd: [BUGS] BUG #14850: Implement optinal additinal parameter for 'justify' date/time function
Date: 2017-10-12 08:00:54
Message-ID: 748681507795254@web14j.yandex.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-general pgsql-hackers

<div><br /></div><div><br /></div><div>-------- Пересылаемое сообщение--------</div><div>11.10.2017, 17:12, "Pavel Stehule" &lt;pavel(dot)stehule(at)gmail(dot)com&gt;:</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">&lt;<a href="mailto:kes-kes(at)yandex(dot)ru" target="_blank">kes-kes(at)yandex(dot)ru</a>&gt;</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 />
&gt;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>

Attachment Content-Type Size
unknown_filename text/html 3.1 KB

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Arthur Zakirov 2017-10-12 09:15:43 Re: BUG #14850: Implement optinal additinal parameter for 'justify' date/time function
Previous Message Michael Paquier 2017-10-12 04:42:54 Re: BUG #14849: jsonb_build_object doesn't like VARIADIC calls very much

Browse pgsql-general by date

  From Date Subject
Next Message Arthur Zakirov 2017-10-12 09:15:43 Re: BUG #14850: Implement optinal additinal parameter for 'justify' date/time function
Previous Message Craig Ringer 2017-10-12 03:10:20 Re: BDR, wal sender, high system cpu, mutex_lock_common

Browse pgsql-hackers by date

  From Date Subject
Next Message Konstantin Knizhnik 2017-10-12 08:09:16 Re: Slow synchronous logical replication
Previous Message Laurenz Albe 2017-10-12 07:27:45 Re: Omission in GRANT documentation