pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: KES <kes-kes@yandex.ru>
To: pgsql-hackers@postgresql.org
To: pgsql-general@postgresql.org
Subject: Fwd: [BUGS] BUG #14850: Implement optinal additinal parameter for 'justify' date/time function
Date: Thu, 12 Oct 2017 11:00:54 +0300
Message-ID: <748681507795254@web14j.yandex.ru> (raw)
In-Reply-To: <CAFj8pRCCaM-=YJ-ksMqjb2=sW=7XbGuP0e8JJPx0sg9gMYWAbA@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

<div><br /></div><div><br /></div><div>-------- Пересылаемое сообщение--------</div><div>11.10.2017, 17:12, "Pavel Stehule" &lt;pavel.stehule@gmail.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@yandex.ru" target="_blank">kes-kes@yandex.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@yandex.ru">kes-kes@yandex.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></di... /></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@postgresql.org">pgsql-bugs@postgresql.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>




view thread (7+ messages)  latest in thread

Message-ID: <748681507795254@web14j.yandex.ru>
Permalink:  ../748681507795254@web14j.yandex.ru/
Also on:    postgresql.org/message-id/748681507795254@web14j.yandex.ru

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: kes-kes@yandex.ru, pgsql-hackers@postgresql.org, pgsql-general@postgresql.org
  Subject: Re: Fwd: [BUGS] BUG #14850: Implement optinal additinal parameter for 'justify' date/time function
  In-Reply-To: <748681507795254@web14j.yandex.ru>
  References: <CAFj8pRCCaM-=YJ-ksMqjb2=sW=7XbGuP0e8JJPx0sg9gMYWAbA@mail.gmail.com> <748681507795254@web14j.yandex.ru>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox